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;