From cddead94d2f22a1dcbd7f90db4cfda96d1815440 Mon Sep 17 00:00:00 2001 From: Alessandro Boch Date: Fri, 7 Apr 2017 14:14:26 -0700 Subject: [PATCH] Do not manage ipv6 for host mode containers Signed-off-by: Alessandro Boch --- libnetwork/osl/namespace_linux.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libnetwork/osl/namespace_linux.go b/libnetwork/osl/namespace_linux.go index 478e3c48d8..d6b9d78234 100644 --- a/libnetwork/osl/namespace_linux.go +++ b/libnetwork/osl/namespace_linux.go @@ -222,9 +222,11 @@ func NewSandbox(key string, osCreate, isRestore bool) (Sandbox, error) { } // As starting point, disable IPv6 on all interfaces - err = setIPv6(n.path, "all", false) - if err != nil { - logrus.Warnf("Failed to disable IPv6 on all interfaces on network namespace %q: %v", n.path, err) + if !n.isDefault { + err = setIPv6(n.path, "all", false) + if err != nil { + logrus.Warnf("Failed to disable IPv6 on all interfaces on network namespace %q: %v", n.path, err) + } } if err = n.loopbackUp(); err != nil {