From 22be52e5d92be9638ea8d78526271a9438f74509 Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Fri, 15 Nov 2024 15:40:10 +0000 Subject: [PATCH] Fix skipping for IPv4 routes --- internal/netlink/ipv6.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/netlink/ipv6.go b/internal/netlink/ipv6.go index 960581881..0f560433e 100644 --- a/internal/netlink/ipv6.go +++ b/internal/netlink/ipv6.go @@ -38,10 +38,11 @@ func (n *NetLink) FindIPv6SupportLevel() (level IPv6SupportLevel, err error) { } n.debugLogger.Debugf("Checking route (link %s): %#v", link.Name, route) - sourceIsIPv6 := route.Src.IsValid() && route.Src.Is6() + sourceIsIPv4 := route.Src.IsValid() && route.Src.Is4() + destinationIsIPv4 := route.Dst.IsValid() && route.Dst.Addr().Is4() destinationIsIPv6 := route.Dst.IsValid() && route.Dst.Addr().Is6() switch { - case !sourceIsIPv6 && !destinationIsIPv6, + case sourceIsIPv4 && destinationIsIPv4, destinationIsIPv6 && route.Dst.Addr().IsLoopback(): case route.Dst.Addr().IsUnspecified(): // default ipv6 route n.debugLogger.Debugf("IPv6 internet access is enabled on link %s", link.Name)