Skip to content

Commit

Permalink
Fix skipping for IPv4 routes
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Nov 15, 2024
1 parent d7f047e commit 22be52e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/netlink/ipv6.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 22be52e

Please sign in to comment.