chore(netlink): log ipv6 support at debug level
This commit is contained in:
@@ -301,12 +301,6 @@ func _main(ctx context.Context, buildInfo models.BuildInformation,
|
||||
return fmt.Errorf("checking for IPv6 support: %w", err)
|
||||
}
|
||||
|
||||
if ipv6Supported {
|
||||
logger.Info("IPv6 is supported")
|
||||
} else {
|
||||
logger.Info("IPv6 is not supported")
|
||||
}
|
||||
|
||||
if err := routingConf.Setup(); err != nil {
|
||||
if strings.Contains(err.Error(), "operation not permitted") {
|
||||
logger.Warn("💡 Tip: Are you passing NET_ADMIN capability to gluetun?")
|
||||
|
||||
@@ -12,6 +12,7 @@ func (n *NetLink) IsIPv6Supported() (supported bool, err error) {
|
||||
return false, fmt.Errorf("listing links: %w", err)
|
||||
}
|
||||
|
||||
var totalRoutes uint
|
||||
for _, link := range links {
|
||||
routes, err := n.RouteList(link, netlink.FAMILY_V6)
|
||||
if err != nil {
|
||||
@@ -26,10 +27,14 @@ func (n *NetLink) IsIPv6Supported() (supported bool, err error) {
|
||||
sourceIsIPv6 := route.Src != nil && route.Src.To4() == nil
|
||||
destinationIsIPv6 := route.Dst != nil && route.Dst.IP.To4() == nil
|
||||
if sourceIsIPv6 || destinationIsIPv6 {
|
||||
n.debugLogger.Debugf("IPv6 is supported by link %s", link.Attrs().Name)
|
||||
return true, nil
|
||||
}
|
||||
totalRoutes++
|
||||
}
|
||||
}
|
||||
|
||||
n.debugLogger.Debugf("IPv6 is not supported after searching %d links and %d routes",
|
||||
len(links), totalRoutes)
|
||||
return false, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user