Skip to content

Commit a3995af

Browse files
committed
Fix cleanup logic in case of ipv6 allocation failure
- When creating a network with both IPv4 and IPv6 subnets, if the allocation of the IPv6 pool fails, the already reserved IPv4 pool does not get released. Signed-off-by: Alessandro Boch <aboch@docker.com>
1 parent b195a10 commit a3995af

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

network.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,12 @@ func (n *network) ipamAllocate() error {
10941094
return nil
10951095
}
10961096

1097-
return n.ipamAllocateVersion(6, ipam)
1097+
err = n.ipamAllocateVersion(6, ipam)
1098+
if err != nil {
1099+
return err
1100+
}
1101+
1102+
return nil
10981103
}
10991104

11001105
func (n *network) requestPoolHelper(ipam ipamapi.Ipam, addressSpace, preferredPool, subPool string, options map[string]string, v6 bool) (string, *net.IPNet, map[string]string, error) {

0 commit comments

Comments
 (0)