Browse Source

Merge pull request #1448 from aboch/pnc

Check if IPv6 is enabled before restoring the network pools
Santhosh Manohar 8 years ago
parent
commit
eb1f7dd441
1 changed files with 5 additions and 3 deletions
  1. 5 3
      libnetwork/controller.go

+ 5 - 3
libnetwork/controller.go

@@ -753,9 +753,11 @@ func (c *controller) reservePools() {
 				c.Gateway = n.ipamV4Info[i].Gateway.IP.String()
 			}
 		}
-		for i, c := range n.ipamV6Config {
-			if c.Gateway == "" && n.ipamV6Info[i].Gateway != nil {
-				c.Gateway = n.ipamV6Info[i].Gateway.IP.String()
+		if n.enableIPv6 {
+			for i, c := range n.ipamV6Config {
+				if c.Gateway == "" && n.ipamV6Info[i].Gateway != nil {
+					c.Gateway = n.ipamV6Info[i].Gateway.IP.String()
+				}
 			}
 		}
 		// Reserve pools