From 938bd72844fd82e5913fae9a24704cf2adf1839d Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Wed, 17 Apr 2013 10:39:32 -0700 Subject: [PATCH] Better handling of the matches rule member. Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Chains.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Chains.pm b/Shorewall/Perl/Shorewall/Chains.pm index 33207bae6..14a437f31 100644 --- a/Shorewall/Perl/Shorewall/Chains.pm +++ b/Shorewall/Perl/Shorewall/Chains.pm @@ -812,6 +812,7 @@ sub set_rule_option( $$$ ) { } push @{$ruleref->{$option}}, ( reftype $value ? @$value : $value ); + push @{$ruleref->{matches}}, $option; } else { assert( ! reftype $value ); $ruleref->{$option} = join(' ', $value1, $value ) unless $value1 eq $value; @@ -834,9 +835,8 @@ sub set_rule_option( $$$ ) { } } else { $ruleref->{$option} = $value; + push @{$ruleref->{matches}}, $option; } - - push @{$ruleref->{matches}}, $option; } sub transform_rule( $;\$ ) { @@ -1330,15 +1330,16 @@ sub push_matches { if ( $globals{KLUDGEFREE} ) { $ruleref->{$option} = [ $curvalue ] unless reftype $curvalue; push @{$ruleref->{$option}}, reftype $value ? @$value : $value; + push @{$ruleref->{matches}}, $option; } else { $ruleref->{$option} = join( '', $curvalue, $value ); } } else { $ruleref->{$option} = $value; $dont_optimize ||= $option =~ /^[piosd]$/ && $value =~ /^!/; + push @{$ruleref->{matches}}, $option; } - push @{$ruleref->{matches}}, $option; } DONT_OPTIMIZE if $dont_optimize;