mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Fix duplicate POSTROUTING MASQUERADE rules
Signed-off-by: Chun Chen <ramichen@tencent.com>
This commit is contained in:
parent
89ff6f6a38
commit
9487241f5c
1 changed files with 6 additions and 1 deletions
|
@ -25,7 +25,12 @@ func (n *bridgeNetwork) setupIPTables(config *networkConfiguration, i *bridgeInt
|
|||
if err != nil {
|
||||
return fmt.Errorf("Failed to setup IP tables, cannot acquire Interface address: %s", err.Error())
|
||||
}
|
||||
if err = setupIPTablesInternal(config.BridgeName, addrv4, config.EnableICC, config.EnableIPMasquerade, hairpinMode, true); err != nil {
|
||||
ipnet := addrv4.(*net.IPNet)
|
||||
maskedAddrv4 := &net.IPNet{
|
||||
IP: ipnet.IP.Mask(ipnet.Mask),
|
||||
Mask: ipnet.Mask,
|
||||
}
|
||||
if err = setupIPTablesInternal(config.BridgeName, maskedAddrv4, config.EnableICC, config.EnableIPMasquerade, hairpinMode, true); err != nil {
|
||||
return fmt.Errorf("Failed to Setup IP tables: %s", err.Error())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue