From e131aef733ec7d45e9fc2fdaaf467532bb4ab35f Mon Sep 17 00:00:00 2001 From: teastep Date: Tue, 8 May 2007 21:23:18 +0000 Subject: [PATCH] reorganize run-time globals management git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6292 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/Shorewall/Chains.pm | 17 +---------------- Shorewall-perl/compiler.pl | 10 ++++++---- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/Shorewall-perl/Shorewall/Chains.pm b/Shorewall-perl/Shorewall/Chains.pm index a93df922a..40641f5ab 100644 --- a/Shorewall-perl/Shorewall/Chains.pm +++ b/Shorewall-perl/Shorewall/Chains.pm @@ -1721,36 +1721,21 @@ sub emitr( $ ) { # sub set_global_variables() { - my $nonempty = 0; - - emitj( 'set_global_variables()', - '{' - ); - - push_indent; # # Establish the values of shell variables used in the following shell commands and/or 'here documents' input. # for ( values %interfaceaddr ) { emit $_; - $nonempty = 1; } for ( values %interfaceaddrs ) { emit $_; - $nonempty = 1; } for ( values %interfacenets ) { emit $_; - $nonempty = 1; } - emit "true" unless $nonempty; - - pop_indent; - - emit "}\n"; } # @@ -1818,7 +1803,7 @@ sub create_netfilter_load() { # # Now generate the actual iptabes-restore command # - emitj( ' exec 3>&-', + emitj( 'exec 3>&-', '', 'progress_message2 "Running iptables-restore..."', '', diff --git a/Shorewall-perl/compiler.pl b/Shorewall-perl/compiler.pl index 7542d547e..9292b0862 100755 --- a/Shorewall-perl/compiler.pl +++ b/Shorewall-perl/compiler.pl @@ -577,8 +577,6 @@ sub generate_script_3() { emit "}\n"; - set_global_variables; - progress_message2 "Creating iptables-restore input..."; create_netfilter_load; @@ -586,9 +584,13 @@ sub generate_script_3() { emit 'define_firewall() {'; push_indent; - emit<<'EOF'; + emit ''; -set_global_variables; + set_global_variables; + + emit ''; + + emit<<'EOF'; setup_routing_and_traffic_shaping;