1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Check if IPv6 is enabled before restoring the network pools

Signed-off-by: Alessandro Boch <aboch@docker.com>
This commit is contained in:
Alessandro Boch 2016-09-15 11:21:33 -07:00
parent ff48f9fdb1
commit 989d9b2cc4

View file

@ -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