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

Serialize non-atomic jump rule programming in bridge

Signed-off-by: Alessandro Boch <aboch@docker.com>
This commit is contained in:
Alessandro Boch 2016-11-23 14:24:17 -08:00
parent afcec80137
commit 138c4b2a77
2 changed files with 6 additions and 1 deletions

View file

@ -714,7 +714,9 @@ func (c *controller) NewNetwork(networkType, name string, id string, options ...
joinCluster(network)
if !c.isDistributedControl() {
c.Lock()
arrangeIngressFilterRule()
c.Unlock()
}
return network, nil

View file

@ -114,7 +114,10 @@ func (n *bridgeNetwork) setupIPTables(config *networkConfiguration, i *bridgeInt
n.portMapper.SetIptablesChain(natChain, n.getNetworkBridgeName())
}
if err := ensureJumpRule("FORWARD", IsolationChain); err != nil {
d.Lock()
err = ensureJumpRule("FORWARD", IsolationChain)
d.Unlock()
if err != nil {
return err
}