mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #1314 from alindeman/bridge-conflict-panic
Avoids panic when checking for conflicts against an uninitalized network
This commit is contained in:
commit
10aec4d8f0
1 changed files with 1 additions and 1 deletions
|
@ -330,7 +330,7 @@ func (c *networkConfiguration) conflictsWithNetworks(id string, others []*bridge
|
||||||
// bridges. This could not be completely caught by the config conflict
|
// bridges. This could not be completely caught by the config conflict
|
||||||
// check, because networks which config does not specify the AddressIPv4
|
// check, because networks which config does not specify the AddressIPv4
|
||||||
// get their address and subnet selected by the driver (see electBridgeIPv4())
|
// get their address and subnet selected by the driver (see electBridgeIPv4())
|
||||||
if c.AddressIPv4 != nil {
|
if c.AddressIPv4 != nil && nwBridge.bridgeIPv4 != nil {
|
||||||
if nwBridge.bridgeIPv4.Contains(c.AddressIPv4.IP) ||
|
if nwBridge.bridgeIPv4.Contains(c.AddressIPv4.IP) ||
|
||||||
c.AddressIPv4.Contains(nwBridge.bridgeIPv4.IP) {
|
c.AddressIPv4.Contains(nwBridge.bridgeIPv4.IP) {
|
||||||
return types.ForbiddenErrorf("conflicts with network %s (%s) by ip network", nwID, nwConfig.BridgeName)
|
return types.ForbiddenErrorf("conflicts with network %s (%s) by ip network", nwID, nwConfig.BridgeName)
|
||||||
|
|
Loading…
Reference in a new issue