Skip to content

Commit

Permalink
add negation support for ipset
Browse files Browse the repository at this point in the history
  • Loading branch information
vzctl committed Oct 19, 2014
1 parent 52d8287 commit e55d4ec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/puppet/provider/firewall/iptables.rb
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def self.rule_to_hash(line, table, counter)
# so it behaves like --comment
values = values.gsub(/(!\s+)?--tcp-flags (\S*) (\S*)/, '--tcp-flags "\1\2 \3"')
# ditto for --match-set
values = values.sub(/--match-set (\S*) (\S*)/, '--match-set "\1 \2"')
values = values.sub(/(!\s+)?--match-set (\S*) (\S*)/, '--match-set "\1\2 \3"')
# we do a similar thing for negated address masks (source and destination).
values = values.gsub(/(-\S+) (!)\s?(\S*)/,'\1 "\2 \3"')
# the actual rule will have the ! mark before the option.
Expand Down Expand Up @@ -331,6 +331,7 @@ def self.rule_to_hash(line, table, counter)
:dport,
:dst_range,
:dst_type,
:ipset,
:port,
:proto,
:source,
Expand Down

0 comments on commit e55d4ec

Please sign in to comment.