From 1b1335835bd9ac803281e9f7c9b79d4d6e33dec1 Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Thu, 1 Dec 2022 12:18:46 +0000 Subject: [PATCH] fix(netlink): inspect each route for IPv6 support --- internal/netlink/ipv6.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/internal/netlink/ipv6.go b/internal/netlink/ipv6.go index ff8cd476..5280a21a 100644 --- a/internal/netlink/ipv6.go +++ b/internal/netlink/ipv6.go @@ -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