From 8c497548cacc1f4e2029b61cb0625dd73d1f8c66 Mon Sep 17 00:00:00 2001 From: teastep Date: Sun, 29 Apr 2007 04:23:10 +0000 Subject: [PATCH] Fix deletion of aliases (some more) git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6148 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/compiler.pl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Shorewall-perl/compiler.pl b/Shorewall-perl/compiler.pl index 531dd2b30..cd3300783 100755 --- a/Shorewall-perl/compiler.pl +++ b/Shorewall-perl/compiler.pl @@ -528,6 +528,18 @@ sub generate_script_2 () { 'delete_proxyarp', '' ); + + if ( $capabilities{NAT_ENABLED} && ! $config{RETAIN_ALIASES} ) { + emitj( '', + 'if [ -f ${VARDIR}/nat ]; then', + ' while read external interface; do', + ' del_ip_addr $external $interface', + ' done < ${VARDIR}/nat', + '', + ' rm -f ${VARDIR}/nat', + 'fi', + '' ); + } emit "delete_tc1\n" if $config{CLEAR_TC}; emit "disable_ipv6\n" if $config{DISABLE_IPV6}; @@ -559,7 +571,7 @@ sub generate_script_3() { dump_zone_contents; emit_unindented '__EOF__'; - emit '> ${VARDIR}/nat'; + emit '> ${VARDIR}/nat' unless $config{RETAIN_ALIASES}; add_addresses;