From 524620504e8641047fcba83ed199dda032fc313b Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Fri, 23 Nov 2012 08:35:51 -0800 Subject: [PATCH] Handle 'fw' correctly in the SOURCE column of the stoppedrules file. Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Misc.pm | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Misc.pm b/Shorewall/Perl/Shorewall/Misc.pm index d7794249c..38a04227e 100644 --- a/Shorewall/Perl/Shorewall/Misc.pm +++ b/Shorewall/Perl/Shorewall/Misc.pm @@ -702,13 +702,11 @@ sub process_stoppedrules() { } if ( $source eq $fw ) { - $chainref = $tableref->{OUTPUT}; + $chainref = ( $target eq 'NOTRACK' ? $raw_table : $filter_table)->{OUTPUT}; $source = ''; $restriction = OUTPUT_RESTRICT; - } - - if ( $source =~ s/^($fw):// ) { - $chainref = $filter_table->{OUTPUT}; + } elsif ( $source =~ s/^($fw):// ) { + $chainref = ( $target eq 'NOTRACK' ? $raw_table : $filter_table)->{OUTPUT}; $restriction = OUTPUT_RESTRICT; } @@ -717,9 +715,7 @@ sub process_stoppedrules() { $chainref = $filter_table->{INPUT}; $dest = ''; $restriction = INPUT_RESTRICT; - } - - if ( $dest =~ s/^($fw):// ) { + } elsif ( $dest =~ s/^($fw):// ) { fatal_error "\$FW may not be specified as the destination of a NOTRACK rule" if $target eq 'NOTRACK'; $chainref = $filter_table->{INPUT}; $restriction = INPUT_RESTRICT;