Pārlūkot izejas kodu

Disable hostname lookup on chain exists check

Without `-n`, iptables will attempt to lookup hostnames for IP
addresses, which can slow down the call dramatically.
Since we don't need this, and generally don't even care about the
output, use the `-n` flag to disable this.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Brian Goff 7 gadi atpakaļ
vecāks
revīzija
1dcffbeb3f
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      libnetwork/iptables/iptables.go

+ 1 - 1
libnetwork/iptables/iptables.go

@@ -456,7 +456,7 @@ func RawCombinedOutputNative(args ...string) error {
 
 // ExistChain checks if a chain exists
 func ExistChain(chain string, table Table) bool {
-	if _, err := Raw("-t", string(table), "-L", chain); err == nil {
+	if _, err := Raw("-t", string(table), "-nL", chain); err == nil {
 		return true
 	}
 	return false