From 6813409c31f0f32febac93e11d2b6ce00774a88e Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Thu, 10 Nov 2011 07:18:46 -0800 Subject: [PATCH] Make the previous patch a bit cleaner Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Misc.pm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Misc.pm b/Shorewall/Perl/Shorewall/Misc.pm index 280d3fa85..3cc4cb149 100644 --- a/Shorewall/Perl/Shorewall/Misc.pm +++ b/Shorewall/Perl/Shorewall/Misc.pm @@ -1468,15 +1468,13 @@ sub add_interface_jumps { } else { add_ijump ( $filter_table->{FORWARD}, j => 'ACCEPT', imatch_source_dev( $interface) , imatch_dest_dev( $interface) ) unless $interfaceref->{nets} || ! $interfaceref->{options}{bridge}; - add_ijump( $filter_table->{FORWARD} , j => $forwardref , imatch_source_dev( $interface ) ) unless $forward_jump_added{$interface} || ! use_forward_chain $interface, $forwardref; - add_ijump( $filter_table->{INPUT} , j => $inputref , imatch_source_dev( $interface ) ) unless $input_jump_added{$interface} || ! use_input_chain $interface, $inputref; + add_ijump( $filter_table->{FORWARD} , j => $forwardref , imatch_source_dev( $interface ) ) unless $forward_jump_added{$interface}++ || ! use_forward_chain $interface, $forwardref; + add_ijump( $filter_table->{INPUT} , j => $inputref , imatch_source_dev( $interface ) ) unless $input_jump_added{$interface} ++ || ! use_input_chain $interface, $inputref; - unless ( $output_jump_added{$interface} || ! use_output_chain $interface, $outputref ) { + unless ( $output_jump_added{$interface}++ || ! use_output_chain $interface, $outputref ) { add_ijump $filter_table->{OUTPUT} , j => $outputref , imatch_dest_dev( $interface ) unless get_interface_option( $interface, 'port' ); } } - - $input_jump_added{$interface} = $output_jump_added{$interface} = $forward_jump_added{$interface} = 1; } handle_loopback_traffic;