Skip to content

Fix/routelist eafnosupport - #2

Merged
Wenri merged 3 commits into
mainfrom
fix/routelist-eafnosupport
Jul 13, 2026
Merged

Wenri merged 3 commits into
mainfrom
fix/routelist-eafnosupport

Conversation

@Wenri

@Wenri Wenri commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

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

  • My changes affect only 10 files or less.
  • I have performed a self-review of my code and tested it.
  • If it is a new feature, I have added thorough tests, my code is <= 1450 lines.
  • If it is a bugfix, my code is <= 200 lines.
  • My functions are <= 80 lines.
  • I have had my code reviewed by a peer.
  • My unit tests pass locally.
  • Netclient & Netmaker are awesome.

Wenri and others added 2 commits February 14, 2026 19:03
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>
Copilot AI review requested due to automatic review settings July 13, 2026 18:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 on EAFNOSUPPORT.
  • Replaces netlink.RouteListFiltered(..., FAMILY_ALL) usage with a similar fallback helper.
  • Adds routeListAll / routeListFilteredAll helper 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
Copilot finished work on behalf of Wenri July 13, 2026 19:06
@Wenri
Wenri merged commit 3d30da8 into main Jul 13, 2026
@Wenri
Wenri deleted the fix/routelist-eafnosupport branch July 13, 2026 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants