fix(netlink): inspect each route for IPv6 support

This commit is contained in:
Quentin McGaw
2022-12-01 12:18:46 +00:00
parent 5070dbcf7f
commit 1b1335835b

View File

@@ -19,11 +19,15 @@ func (n *NetLink) IsIPv6Supported() (supported bool, err error) {
link.Attrs().Name, err)
}
if len(routes) == 0 {
continue
// Check each route for IPv6 due to Podman bug listing IPv4 routes
// as IPv6 routes at container start, see:
// https://github.com/qdm12/gluetun/issues/1241#issuecomment-1333405949
for _, route := range routes {
if route.Dst.IP.To4() == nil ||
route.Src.To4() == nil { // Destination or source IP is IPv6
return true, nil
}
}
return true, nil
}
return false, nil