소스 검색

libnetwork/iptables: IPTable.RemoveExistingChain() slight refactor

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 2 년 전
부모
커밋
ea4baa24b1
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      libnetwork/iptables/iptables.go

+ 3 - 3
libnetwork/iptables/iptables.go

@@ -275,14 +275,14 @@ func (iptable IPTable) ProgramChain(c *ChainInfo, bridgeName string, hairpinMode
 
 // RemoveExistingChain removes existing chain from the table.
 func (iptable IPTable) RemoveExistingChain(name string, table Table) error {
+	if table == "" {
+		table = Filter
+	}
 	c := &ChainInfo{
 		Name:    name,
 		Table:   table,
 		IPTable: iptable,
 	}
-	if string(c.Table) == "" {
-		c.Table = Filter
-	}
 	return c.Remove()
 }