Repository navigation
Fix/routelist eafnosupport - #2
Merged
Merged
Conversation
Virtuozzo/OpenVZ 3.10.x kernels do not support RTM_GETROUTE dump with AF_UNSPEC, returning EAFNOSUPPORT. This caused netclient to fail on interface configuration and default gateway detection, preventing the daemon from applying any peer updates. Add routeListAll and routeListFilteredAll helpers that try FAMILY_ALL first and fall back to querying FAMILY_V4 and FAMILY_V6 separately. Also set WG_QUICK_USERSPACE_IMPLEMENTATION in Dockerfile. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Linux WireGuard route enumeration to handle kernels that return EAFNOSUPPORT when dumping routes with AF_UNSPEC (i.e., netlink.FAMILY_ALL), by falling back to querying IPv4 and IPv6 routes separately.
Changes:
- Replaces direct
netlink.RouteList(..., FAMILY_ALL)usage with a helper that falls back to separate v4/v6 queries onEAFNOSUPPORT. - Replaces
netlink.RouteListFiltered(..., FAMILY_ALL)usage with a similar fallback helper. - Adds
routeListAll/routeListFilteredAllhelper functions to centralize this behavior.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+726
to
+731
| v4, err4 := netlink.RouteList(link, netlink.FAMILY_V4) | ||
| if err4 != nil { | ||
| return nil, err4 | ||
| } | ||
| v6, _ := netlink.RouteList(link, netlink.FAMILY_V6) | ||
| return append(v4, v6...), nil |
Comment on lines
+744
to
+749
| v4, err4 := netlink.RouteListFiltered(netlink.FAMILY_V4, filter, filterMask) | ||
| if err4 != nil { | ||
| return nil, err4 | ||
| } | ||
| v6, _ := netlink.RouteListFiltered(netlink.FAMILY_V6, filter, filterMask) | ||
| return append(v4, v6...), nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
Provide Issue ticket number if applicable/not in title
Provide link to Netmaker PR if required
Provide testing steps
Checklist before requesting a review