Skip to content

Commit

Permalink
Check if IPv6 is enabled before restoring the network pools
Browse files Browse the repository at this point in the history
Signed-off-by: Alessandro Boch <aboch@docker.com>
  • Loading branch information
aboch committed Sep 15, 2016
1 parent c1f6d91 commit 214f592
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 214f592

Please sign in to comment.