feat(wireguard): add debug logs for IPv6 detection
- To debug issue #998 - Enable with `LOG_LEVEL=debug`
This commit is contained in:
@@ -12,16 +12,23 @@ func (w *Wireguard) isIPv6Supported() (supported bool, err error) {
|
||||
return false, fmt.Errorf("cannot list links: %w", err)
|
||||
}
|
||||
|
||||
w.logger.Debug("Checking for IPv6 support...")
|
||||
for _, link := range links {
|
||||
linkName := link.Attrs().Name
|
||||
routes, err := w.netlink.RouteList(link, netlink.FAMILY_V6)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("cannot list routes: %w", err)
|
||||
return false, fmt.Errorf("cannot list routes for link %s: %w", linkName, err)
|
||||
}
|
||||
|
||||
if len(routes) > 0 {
|
||||
return true, nil
|
||||
if len(routes) == 0 {
|
||||
w.logger.Debugf("Link %s has no IPv6 route", linkName)
|
||||
continue
|
||||
}
|
||||
|
||||
w.logger.Debugf("Link %s has IPv6 routes: %#v",
|
||||
linkName, routes)
|
||||
supported = true
|
||||
}
|
||||
|
||||
return false, nil
|
||||
return supported, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user