Skip to content

Commit

Permalink
hotfix(netlink): ipv6 detection for nil src/dst in routes
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Dec 2, 2022
1 parent 74426f6 commit cc934f5
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 @@ -23,8 +23,9 @@ func (n *NetLink) IsIPv6Supported() (supported bool, err error) {
// 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
sourceIsIPv6 := route.Src != nil && route.Src.To4() == nil
destinationIsIPv6 := route.Dst != nil && route.Dst.IP.To4() == nil
if sourceIsIPv6 || destinationIsIPv6 {
return true, nil
}
}
Expand Down

0 comments on commit cc934f5

Please sign in to comment.