소스 검색

Merge pull request #2609 from bboehmke/firewalld_passthrough_ipv6

fixed IPv6 iptables rules for enabled firewalld
Arko Dasgupta 4 년 전
부모
커밋
da68ca912a
1개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  1. 7 1
      libnetwork/iptables/iptables.go

+ 7 - 1
libnetwork/iptables/iptables.go

@@ -512,8 +512,14 @@ func filterOutput(start time.Time, output []byte, args ...string) []byte {
 // Raw calls 'iptables' system command, passing supplied arguments.
 func (iptable IPTable) Raw(args ...string) ([]byte, error) {
 	if firewalldRunning {
+		// select correct IP version for firewalld
+		ipv := Iptables
+		if iptable.Version == IPv6 {
+			ipv = IP6Tables
+		}
+
 		startTime := time.Now()
-		output, err := Passthrough(Iptables, args...)
+		output, err := Passthrough(ipv, args...)
 		if err == nil || !strings.Contains(err.Error(), "was not provided by any .service files") {
 			return filterOutput(startTime, output, args...), err
 		}