Handle 'fw' correctly in the SOURCE column of the stoppedrules file.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-11-23 08:35:51 -08:00
parent b6a1a7d538
commit 71bbc632ce

View File

@ -702,13 +702,11 @@ sub process_stoppedrules() {
} }
if ( $source eq $fw ) { if ( $source eq $fw ) {
$chainref = $tableref->{OUTPUT}; $chainref = ( $target eq 'NOTRACK' ? $raw_table : $filter_table)->{OUTPUT};
$source = ''; $source = '';
$restriction = OUTPUT_RESTRICT; $restriction = OUTPUT_RESTRICT;
} } elsif ( $source =~ s/^($fw):// ) {
$chainref = ( $target eq 'NOTRACK' ? $raw_table : $filter_table)->{OUTPUT};
if ( $source =~ s/^($fw):// ) {
$chainref = $filter_table->{OUTPUT};
$restriction = OUTPUT_RESTRICT; $restriction = OUTPUT_RESTRICT;
} }
@ -717,9 +715,7 @@ sub process_stoppedrules() {
$chainref = $filter_table->{INPUT}; $chainref = $filter_table->{INPUT};
$dest = ''; $dest = '';
$restriction = INPUT_RESTRICT; $restriction = INPUT_RESTRICT;
} } elsif ( $dest =~ s/^($fw):// ) {
if ( $dest =~ s/^($fw):// ) {
fatal_error "\$FW may not be specified as the destination of a NOTRACK rule" if $target eq 'NOTRACK'; fatal_error "\$FW may not be specified as the destination of a NOTRACK rule" if $target eq 'NOTRACK';
$chainref = $filter_table->{INPUT}; $chainref = $filter_table->{INPUT};
$restriction = INPUT_RESTRICT; $restriction = INPUT_RESTRICT;