From 60c36f88a5aaa051f111c96d0fb10fd6542f5f2e Mon Sep 17 00:00:00 2001 From: Alessandro Boch Date: Fri, 7 Apr 2017 16:35:29 -0700 Subject: [PATCH 1/2] Vendoring libnetwork @ab8f7e6 Signed-off-by: Alessandro Boch --- vendor.conf | 2 +- vendor/github.com/docker/libnetwork/iptables/firewalld.go | 1 - .../github.com/docker/libnetwork/osl/namespace_linux.go | 8 +++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/vendor.conf b/vendor.conf index 61a947ecfb..9590db8611 100644 --- a/vendor.conf +++ b/vendor.conf @@ -24,7 +24,7 @@ github.com/RackSec/srslog 456df3a81436d29ba874f3590eeeee25d666f8a5 github.com/imdario/mergo 0.2.1 #get libnetwork packages -github.com/docker/libnetwork f3c4ca8ce5c128e071bab198c4ed9fd0d08384eb +github.com/docker/libnetwork ab8f7e61743aa7e54c5d0dad0551543adadc33cf github.com/docker/go-events 18b43f1bc85d9cdd42c05a6cd2d444c7a200a894 github.com/armon/go-radix e39d623f12e8e41c7b5529e9a9dd67a1e2261f80 github.com/armon/go-metrics eb0af217e5e9747e41dd5303755356b62d28e3ec diff --git a/vendor/github.com/docker/libnetwork/iptables/firewalld.go b/vendor/github.com/docker/libnetwork/iptables/firewalld.go index 970931ce91..7dc5127fa4 100644 --- a/vendor/github.com/docker/libnetwork/iptables/firewalld.go +++ b/vendor/github.com/docker/libnetwork/iptables/firewalld.go @@ -151,7 +151,6 @@ func checkRunning() bool { if connection != nil { err = connection.sysobj.Call(dbusInterface+".getDefaultZone", 0).Store(&zone) - logrus.Infof("Firewalld running: %t", err == nil) return err == nil } return false diff --git a/vendor/github.com/docker/libnetwork/osl/namespace_linux.go b/vendor/github.com/docker/libnetwork/osl/namespace_linux.go index 478e3c48d8..d6b9d78234 100644 --- a/vendor/github.com/docker/libnetwork/osl/namespace_linux.go +++ b/vendor/github.com/docker/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 { From 010e5a228a633c6854ac28de62d5338c9206e80c Mon Sep 17 00:00:00 2001 From: Alessandro Boch Date: Fri, 7 Apr 2017 16:57:53 -0700 Subject: [PATCH 2/2] Add test over ipv6 and container run in host network Signed-off-by: Alessandro Boch --- integration-cli/docker_cli_daemon_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/integration-cli/docker_cli_daemon_test.go b/integration-cli/docker_cli_daemon_test.go index 53bc45e8f2..bab94d8fe1 100644 --- a/integration-cli/docker_cli_daemon_test.go +++ b/integration-cli/docker_cli_daemon_test.go @@ -428,6 +428,22 @@ func (s *DockerDaemonSuite) TestDaemonIPv6FixedCIDRAndMac(c *check.C) { c.Assert(strings.Trim(out, " \r\n'"), checker.Equals, "2001:db8:1::aabb:ccdd:eeff") } +// TestDaemonIPv6HostMode checks that when the running a container with +// network=host the host ipv6 addresses are not removed +func (s *DockerDaemonSuite) TestDaemonIPv6HostMode(c *check.C) { + testRequires(c, SameHostDaemon) + deleteInterface(c, "docker0") + + s.d.StartWithBusybox(c, "--ipv6", "--fixed-cidr-v6=2001:db8:2::/64") + out, err := s.d.Cmd("run", "-itd", "--name=hostcnt", "--network=host", "busybox:latest") + c.Assert(err, checker.IsNil, check.Commentf("Could not run container: %s, %v", out, err)) + + out, err = s.d.Cmd("exec", "hostcnt", "ip", "-6", "addr", "show", "docker0") + out = strings.Trim(out, " \r\n'") + + c.Assert(out, checker.Contains, "2001:db8:2::1") +} + func (s *DockerDaemonSuite) TestDaemonLogLevelWrong(c *check.C) { c.Assert(s.d.StartWithError("--log-level=bogus"), check.NotNil, check.Commentf("Daemon shouldn't start with wrong log level")) }