Skip to content

Commit

Permalink
Support --sport/--dport on ip6tables
Browse files Browse the repository at this point in the history
  • Loading branch information
cataphract authored and Morgan Haskel committed Dec 29, 2014
1 parent 89e8471 commit 946cf58
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/puppet/provider/firewall/ip6tables.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def self.iptables_save(*args)
:connmark => "-m connmark --mark",
:ctstate => "-m conntrack --ctstate",
:destination => "-d",
:dport => "-m multiport --dports",
:dport => ["-m multiport --dports", "--dport"],
:gid => "-m owner --gid-owner",
:hop_limit => "-m hl --hl-eq",
:icmp => "-m icmp6 --icmpv6-type",
Expand All @@ -81,7 +81,7 @@ def self.iptables_save(*args)
:rsource => "--rsource",
:rttl => "--rttl",
:source => "-s",
:sport => "-m multiport --sports",
:sport => ["-m multiport --sports", "--sport"],
:stat_every => '--every',
:stat_mode => "-m statistic --mode",
:stat_packet => '--packet',
Expand Down
10 changes: 10 additions & 0 deletions spec/fixtures/ip6tables/conversion_hash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@
:destination => '2001:db8:4321::/48',
},
},
'udp_source_port_and_destination_port' => {
:line => '-A ufw6-before-input -s fe80::/10 -d fe80::/10 -p udp -m udp --sport 547 --dport 546 -j ACCEPT',
:table => 'filter',
:provider => 'ip6tables',
:params => {
:proto => 'udp',
:sport => ['547'],
:dport => ['546'],
},
}
}

# This hash is for testing converting a hash to an argument line.
Expand Down

0 comments on commit 946cf58

Please sign in to comment.