From 7f5a1c1056f5ccd42990e84d12875fe70405d5d4 Mon Sep 17 00:00:00 2001 From: teastep Date: Fri, 16 Jan 2009 22:39:12 +0000 Subject: [PATCH] Eliminate one generated function git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@9296 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/Shorewall/Compiler.pm | 48 +++++++++++++++------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/Shorewall-perl/Shorewall/Compiler.pm b/Shorewall-perl/Shorewall/Compiler.pm index de3ad2632..f99e0ade3 100644 --- a/Shorewall-perl/Shorewall/Compiler.pm +++ b/Shorewall-perl/Shorewall/Compiler.pm @@ -626,7 +626,7 @@ sub generate_script_2 () { } emit( "\n#", - '# Setup Common Rules', + '# Setup Common Rules (/proc)', '#', 'setup_common_rules() {' ); @@ -672,27 +672,6 @@ sub generate_script_3 () { # sub generate_script_4($) { - emit 'cat > ${VARDIR}/proxyarp << __EOF__'; - dump_proxy_arp; - emit_unindented '__EOF__'; - - emit( '', - 'if [ "$COMMAND" != refresh ]; then' ); - - push_indent; - - emit 'cat > ${VARDIR}/zones << __EOF__'; - dump_zone_contents; - emit_unindented '__EOF__'; - - pop_indent; - - emit "fi\n"; - - emit '> ${VARDIR}/nat'; - - add_addresses; - pop_indent; emit "}\n"; @@ -785,7 +764,30 @@ sub generate_script_4($) { emit( 'setup_common_rules', '', 'setup_routing_and_traffic_shaping', - '', + ''); + + emit 'cat > ${VARDIR}/proxyarp << __EOF__'; + dump_proxy_arp; + emit_unindented '__EOF__'; + + emit( '', + 'if [ "$COMMAND" != refresh ]; then' ); + + push_indent; + + emit 'cat > ${VARDIR}/zones << __EOF__'; + dump_zone_contents; + emit_unindented '__EOF__'; + + pop_indent; + + emit "fi\n"; + + emit '> ${VARDIR}/nat'; + + add_addresses; + + emit( '', 'if [ $COMMAND = restore ]; then', ' iptables_save_file=${VARDIR}/$(basename $0)-iptables', ' if [ -f $iptables_save_file ]; then' );