Skip to content

Commit 954d1dd

Browse files
authored
Merge pull request #2609 from bboehmke/firewalld_passthrough_ipv6
fixed IPv6 iptables rules for enabled firewalld
2 parents fa125a3 + 2b09ede commit 954d1dd

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

iptables/iptables.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,14 @@ func filterOutput(start time.Time, output []byte, args ...string) []byte {
512512
// Raw calls 'iptables' system command, passing supplied arguments.
513513
func (iptable IPTable) Raw(args ...string) ([]byte, error) {
514514
if firewalldRunning {
515+
// select correct IP version for firewalld
516+
ipv := Iptables
517+
if iptable.Version == IPv6 {
518+
ipv = IP6Tables
519+
}
520+
515521
startTime := time.Now()
516-
output, err := Passthrough(Iptables, args...)
522+
output, err := Passthrough(ipv, args...)
517523
if err == nil || !strings.Contains(err.Error(), "was not provided by any .service files") {
518524
return filterOutput(startTime, output, args...), err
519525
}

0 commit comments

Comments
 (0)