Skip to content

Commit 58748d7

Browse files
committed
Register natChain with portmapper
- Becasue it is the only chain which carries the hairpin mode info - Also install the skipDNAT rule only if userland-proxy == true Signed-off-by: Alessandro Boch <aboch@docker.com>
1 parent 7586649 commit 58748d7

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

drivers/bridge/setup_ip_tables.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func (n *bridgeNetwork) setupIPTables(config *networkConfiguration, i *bridgeInt
115115
return iptables.ProgramChain(filterChain, config.BridgeName, hairpinMode, false)
116116
})
117117

118-
n.portMapper.SetIptablesChain(filterChain, n.getNetworkBridgeName())
118+
n.portMapper.SetIptablesChain(natChain, n.getNetworkBridgeName())
119119
}
120120

121121
if err := ensureJumpRule("FORWARD", IsolationChain); err != nil {
@@ -148,6 +148,9 @@ func setupIPTablesInternal(bridgeIface string, addr net.Addr, icc, ipmasq, hairp
148148
if err := programChainRule(natRule, "NAT", enable); err != nil {
149149
return err
150150
}
151+
}
152+
153+
if ipmasq && !hairpin {
151154
if err := programChainRule(skipDNAT, "SKIP DNAT", enable); err != nil {
152155
return err
153156
}

0 commit comments

Comments
 (0)