From c7848be266b68b248de871febb45eb7a8bcc19e3 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Mon, 3 May 2010 09:59:25 -0700 Subject: [PATCH] Back out the rest of the original change for dup / -[psiod] Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Nat.pm | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Nat.pm b/Shorewall/Perl/Shorewall/Nat.pm index c216bb785..e9934443f 100644 --- a/Shorewall/Perl/Shorewall/Nat.pm +++ b/Shorewall/Perl/Shorewall/Nat.pm @@ -390,10 +390,8 @@ sub do_one_nat( $$$$$ ) add_nat_rule 'nat_in' , "-d $external $policyin -j DNAT --to-destination $internal"; add_nat_rule 'nat_out' , "-s $internal $policyout -j SNAT --to-source $external"; } else { - my $chainref = input_chain( $interface ); - add_nat_rule $chainref , $rulein . "-d $external $policyin -j DNAT --to-destination $internal"; - $chainref = output_chain( $interface ); - add_nat_rule $chainref , $ruleout . "-s $internal $policyout -j SNAT --to-source $external"; + add_nat_rule input_chain( $interface ) , $rulein . "-d $external $policyin -j DNAT --to-destination $internal"; + add_nat_rule output_chain( $interface ) , $ruleout . "-s $internal $policyout -j SNAT --to-source $external"; } add_nat_rule 'OUTPUT' , "-d $external $policyout -j DNAT --to-destination $internal " if $localnat; @@ -467,11 +465,9 @@ sub setup_netmap() { } if ( $type eq 'DNAT' ) { - my $chainref = ensure_chain( 'nat' , input_chain $interface ); - add_rule $chainref , $rulein . "-d $net1 -j NETMAP --to $net2"; + add_rule ensure_chain( 'nat' , input_chain $interface ) , $rulein . "-d $net1 -j NETMAP --to $net2"; } elsif ( $type eq 'SNAT' ) { - my $chainref = ensure_chain( 'nat' , output_chain $interface ); - add_rule $chainref , $ruleout . "-s $net1 -j NETMAP --to $net2"; + add_rule ensure_chain( 'nat' , output_chain $interface ) , $ruleout . "-s $net1 -j NETMAP --to $net2"; } else { fatal_error "Invalid type ($type)"; }