From 29f51b52b4ac98bdab7468e70ea98706bf7cabfc Mon Sep 17 00:00:00 2001 From: teastep Date: Mon, 23 Apr 2007 23:17:30 +0000 Subject: [PATCH] Fix dynamic zone problem git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6095 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/Shorewall/Config.pm | 23 +++++++++++------------ Shorewall-perl/Shorewall/Rules.pm | 11 ++++++----- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Shorewall-perl/Shorewall/Config.pm b/Shorewall-perl/Shorewall/Config.pm index 73940ba31..361fd838d 100644 --- a/Shorewall-perl/Shorewall/Config.pm +++ b/Shorewall-perl/Shorewall/Config.pm @@ -780,9 +780,9 @@ sub get_configuration( $ ) { determine_capabilities; } } elsif ( $export ) { - fatal_error "The -e flag requires a capabilities file" unless open_file 'capabilities'; + open_file 'capabilities' or fatal_error "The -e flag requires a capabilities file"; } else { - fatal_error "Compiling under an ordinary user id requires a capabilities file" unless open_file 'capabilities'; + open_file 'capabilities' or fatal_error "Compiling under an ordinary user id requires a capabilities file"; } $globals{ORIGINAL_POLICY_MATCH} = $capabilities{POLICY_MATCH}; @@ -817,7 +817,6 @@ sub get_configuration( $ ) { check_trivalue ( 'ROUTE_FILTER', '' ); check_trivalue ( 'LOG_MARTIANS', '' ); - default_yes_no 'ADD_IP_ALIASES' , 'Yes'; default_yes_no 'ADD_SNAT_ALIASES' , ''; default_yes_no 'DETECT_DNAT_IPADDRS' , ''; @@ -915,15 +914,15 @@ sub get_configuration( $ ) { default 'TC_ENABLED' , 'Internal'; - if ( $val = "\L$config{TC_ENABLED}" ) { - if ( $val eq 'yes' ) { - $file = find_file 'tcstart'; - fatal_error "Unable to find tcstart file" unless -f $file; - $globals{TC_SCRIPT} = $file; - } elsif ( $val ne 'internal' ) { - fatal_error "Invalid value ($config{TC_ENABLED}) for TC_ENABLED" unless $val eq 'no'; - $config{TC_ENABLED} = ''; - } + $val = "\L$config{TC_ENABLED}"; + + if ( $val eq 'yes' ) { + $file = find_file 'tcstart'; + fatal_error "Unable to find tcstart file" unless -f $file; + $globals{TC_SCRIPT} = $file; + } elsif ( $val ne 'internal' ) { + fatal_error "Invalid value ($config{TC_ENABLED}) for TC_ENABLED" unless $val eq 'no'; + $config{TC_ENABLED} = ''; } default 'RESTOREFILE' , 'restore'; diff --git a/Shorewall-perl/Shorewall/Rules.pm b/Shorewall-perl/Shorewall/Rules.pm index 0ba7554d5..0de90d26c 100644 --- a/Shorewall-perl/Shorewall/Rules.pm +++ b/Shorewall-perl/Shorewall/Rules.pm @@ -598,15 +598,16 @@ sub add_common_rules() { for $chain ( @{dynamic_chains $interface} ) { new_standard_chain $chain; } - } - (new_chain 'nat' , $chain = dynamic_in($interface) )->{referenced} = 1; + (new_chain 'nat' , $chain = dynamic_in($interface) )->{referenced} = 1; - add_rule $filter_table->{input_chain $interface}, "-j $chain"; - add_rule $filter_table->{forward_chain $interface}, '-j ' . dynamic_fwd $interface; - add_rule $filter_table->{output_chain $interface}, '-j ' . dynamic_out $interface; + add_rule $filter_table->{input_chain $interface}, "-j $chain"; + add_rule $filter_table->{forward_chain $interface}, '-j ' . dynamic_fwd $interface; + add_rule $filter_table->{output_chain $interface}, '-j ' . dynamic_out $interface; + } } + $list = find_interfaces_by_option 'upnp'; if ( @$list ) {