From c2644a1beeae2d2c046d9161e318ab0a6ef9c1b3 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Wed, 9 Apr 2014 15:41:14 +0200 Subject: [PATCH] Fix libcontainer network support on rhel6 It seems that netlink in older kernels, including RHEL6, does not support RTM_SETLINK with IFLA_MASTER. It just silently ignores it, reporting no error, causing netlink.NetworkSetMaster() to not do anything yet return no error. We fix this by introducing and using AddToBridge() in a very similar manner to CreateBridge(), which use the old ioctls directly. This fixes https://github.com/dotcloud/docker/issues/4668 Docker-DCO-1.1-Signed-off-by: Alexander Larsson (github: alexlarsson) --- network/network.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network/network.go b/network/network.go index 8c7a4b618..f8dee4527 100644 --- a/network/network.go +++ b/network/network.go @@ -50,7 +50,7 @@ func SetInterfaceMaster(name, master string) error { if err != nil { return err } - return netlink.NetworkSetMaster(iface, masterIface) + return netlink.AddToBridge(iface, masterIface) } func SetDefaultGateway(ip string) error {