From 17f21b2f0599ce6a6ba9f5470e18462b2180d8d7 Mon Sep 17 00:00:00 2001 From: teastep Date: Wed, 1 Mar 2006 17:53:45 +0000 Subject: [PATCH] Avoid 'delete_nat doesn't exist' Errors git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@3612 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall/changelog.txt | 2 ++ Shorewall/compiler | 13 +++++++++++++ Shorewall/releasenotes.txt | 3 +++ 3 files changed, 18 insertions(+) diff --git a/Shorewall/changelog.txt b/Shorewall/changelog.txt index 8b9d2d140..ff4815e62 100644 --- a/Shorewall/changelog.txt +++ b/Shorewall/changelog.txt @@ -101,3 +101,5 @@ Changes in 3.1.x. define_firewall().) 43) Add Simon's redhat prog files. + +44) Add 'delete_nat' to compiled program. diff --git a/Shorewall/compiler b/Shorewall/compiler index f58c46d06..5f06d7984 100755 --- a/Shorewall/compiler +++ b/Shorewall/compiler @@ -8128,6 +8128,19 @@ stop_firewall() { \$IPTABLES -A \$1 -m state --state ESTABLISHED,RELATED -j ACCEPT } + delete_nat() { + \$IPTABLES -t nat -F + \$IPTABLES -t nat -X + + if [ -f /var/lib/shorewall/nat ]; then + while read external interface; do + qt ip addr del $external dev $interface + done < /var/lib/shorewall/nat + + rm -f {/var/lib/shorewall}/nat + fi + } + case \$COMMAND in stop|clear) ;; diff --git a/Shorewall/releasenotes.txt b/Shorewall/releasenotes.txt index 81db9274c..d31c23166 100644 --- a/Shorewall/releasenotes.txt +++ b/Shorewall/releasenotes.txt @@ -35,6 +35,9 @@ Problems Corrected in 3.1.9 2) If any extension script used 'set --' (like the 'Limit' standard action extension script) then 'shorewall restore' would fail. +3) An undefined function 'delete_nat' was previously called when a compiled + program was issued the 'stop' or 'clear' command. + Other changes in 3.1.9 1) The 'redhat' distribution is now supported in the compile command's -d