Procházet zdrojové kódy

Merge pull request #933 from aboch/iptfu

Register natChain with portmapper
Madhu Venugopal před 9 roky
rodič
revize
e9ec59b4f1
1 změnil soubory, kde provedl 4 přidání a 1 odebrání
  1. 4 1
      libnetwork/drivers/bridge/setup_ip_tables.go

+ 4 - 1
libnetwork/drivers/bridge/setup_ip_tables.go

@@ -115,7 +115,7 @@ func (n *bridgeNetwork) setupIPTables(config *networkConfiguration, i *bridgeInt
 			return iptables.ProgramChain(filterChain, config.BridgeName, hairpinMode, false)
 		})
 
-		n.portMapper.SetIptablesChain(filterChain, n.getNetworkBridgeName())
+		n.portMapper.SetIptablesChain(natChain, n.getNetworkBridgeName())
 	}
 
 	if err := ensureJumpRule("FORWARD", IsolationChain); err != nil {
@@ -148,6 +148,9 @@ func setupIPTablesInternal(bridgeIface string, addr net.Addr, icc, ipmasq, hairp
 		if err := programChainRule(natRule, "NAT", enable); err != nil {
 			return err
 		}
+	}
+
+	if ipmasq && !hairpin {
 		if err := programChainRule(skipDNAT, "SKIP DNAT", enable); err != nil {
 			return err
 		}