From 610bdf1aac74a4f487aa34ab077ab3fc906a357a Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Fri, 19 Apr 2013 08:40:01 -0700 Subject: [PATCH] Correct merge_rules() for LAST matches. Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Chains.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Shorewall/Perl/Shorewall/Chains.pm b/Shorewall/Perl/Shorewall/Chains.pm index 0dbd8a513..a8a98cb02 100644 --- a/Shorewall/Perl/Shorewall/Chains.pm +++ b/Shorewall/Perl/Shorewall/Chains.pm @@ -1094,6 +1094,10 @@ sub merge_rules( $$$ ) { set_rule_option( $toref, 'policy', $fromref->{policy} ) if exists $fromref->{policy}; + for my $option ( grep( ( $opttype{$_} || 0 ) == LAST, keys %$fromref ) ) { + set_rule_option( $toref, $option, $fromref->{$option} ); + } + unless ( $toref->{comment} ) { $toref->{comment} = $fromref->{comment} if exists $fromref->{comment}; }