From: Gustavo Lopes Date: Fri, 26 Sep 2014 13:41:09 +0000 (+0200) Subject: Support --sport/--dport on ip6tables X-Git-Tag: 1.4.0~27^2~1 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=946cf581b97905361339066c83aada28a699f645;p=puppet-modules%2Fpuppetlabs-firewall.git Support --sport/--dport on ip6tables --- diff --git a/lib/puppet/provider/firewall/ip6tables.rb b/lib/puppet/provider/firewall/ip6tables.rb index e517519..d58b86d 100644 --- a/lib/puppet/provider/firewall/ip6tables.rb +++ b/lib/puppet/provider/firewall/ip6tables.rb @@ -54,7 +54,7 @@ Puppet::Type.type(:firewall).provide :ip6tables, :parent => :iptables, :source = :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", @@ -81,7 +81,7 @@ Puppet::Type.type(:firewall).provide :ip6tables, :parent => :iptables, :source = :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', diff --git a/spec/fixtures/ip6tables/conversion_hash.rb b/spec/fixtures/ip6tables/conversion_hash.rb index 7c507d7..d752378 100644 --- a/spec/fixtures/ip6tables/conversion_hash.rb +++ b/spec/fixtures/ip6tables/conversion_hash.rb @@ -24,6 +24,16 @@ ARGS_TO_HASH6 = { :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.