From d03c28eeeb9b8ad3a6103ab48224e81a6a46df7c Mon Sep 17 00:00:00 2001 From: Ondrej Fabry Date: Mon, 27 May 2019 08:30:41 +0200 Subject: [PATCH] Fix IPv6 detection for IP address (fixes #1350) Signed-off-by: Ondrej Fabry --- plugins/linux/ifplugin/descriptor/interface.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/linux/ifplugin/descriptor/interface.go b/plugins/linux/ifplugin/descriptor/interface.go index 14e060605d..b0889287d2 100644 --- a/plugins/linux/ifplugin/descriptor/interface.go +++ b/plugins/linux/ifplugin/descriptor/interface.go @@ -363,7 +363,7 @@ func (d *InterfaceDescriptor) Create(key string, linuxIf *interfaces.Interface) for _, ipAddress := range ipAddresses { // Make sure sysctl "disable_ipv6" is 0 if we are about to add // an IPv6 address to the interface - if !hasEnabledIPv6 && ipAddress.IP.To16() != nil { + if !hasEnabledIPv6 && ipAddress.IP != nil && ipAddress.IP.To4() == nil { // Enabled IPv6 for loopback "lo" and the interface // being configured for _, iface := range [2]string{"lo", hostName} {