From a3b7b9c11bf37416eae1dc454e0c367d44b29ba9 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Sun, 12 Sep 2010 10:07:26 -0700 Subject: [PATCH] Delete unused functions from prog.header* Signed-off-by: Tom Eastep --- Shorewall/Perl/prog.header | 47 ++++--------------------------------- Shorewall/Perl/prog.header6 | 35 ++------------------------- 2 files changed, 6 insertions(+), 76 deletions(-) diff --git a/Shorewall/Perl/prog.header b/Shorewall/Perl/prog.header index 2a601b255..d19be77d0 100644 --- a/Shorewall/Perl/prog.header +++ b/Shorewall/Perl/prog.header @@ -80,46 +80,6 @@ progress_message3() # $* = Message fi } -# -# Set a standard chain's policy -# -setpolicy() # $1 = name of chain, $2 = policy -{ - run_iptables -P $1 $2 -} - -# -# Set a standard chain to enable established and related connections -# -setcontinue() # $1 = name of chain -{ - run_iptables -A $1 -m state --state ESTABLISHED,RELATED -j ACCEPT -} - -# -# Flush one of the NAT table chains -# -flushnat() # $1 = name of chain -{ - run_iptables -t nat -F $1 -} - -# -# Flush one of the Mangle table chains -# -flushmangle() # $1 = name of chain -{ - run_iptables -t mangle -F $1 -} - -# -# Flush and delete all user-defined chains in the filter table -# -deleteallchains() { - run_iptables -F - run_iptables -X -} - # # Generate a list of all network interfaces on the system # @@ -540,11 +500,12 @@ undo_routing() { # Restore the default route that was in place before the initial 'shorewall start' # restore_default_route() { + local result + if [ -z "$g_noroutes" -a -f ${VARDIR}/default_route ]; then local default_route default_route= local route - local result result=1 while read route ; do @@ -629,9 +590,9 @@ delete_proxyarp() { f=/proc/sys/net/ipv4/conf/$interface/proxy_arp [ -f $f ] && echo 0 > $f done < ${VARDIR}/proxyarp - fi - rm -f ${VARDIR}/proxyarp + rm -f ${VARDIR}/proxyarp + fi } # diff --git a/Shorewall/Perl/prog.header6 b/Shorewall/Perl/prog.header6 index ce73f6e3c..8bf3638dc 100644 --- a/Shorewall/Perl/prog.header6 +++ b/Shorewall/Perl/prog.header6 @@ -80,38 +80,6 @@ progress_message3() # $* = Message fi } -# -# Set a standard chain's policy -# -setpolicy() # $1 = name of chain, $2 = policy -{ - run_iptables -P $1 $2 -} - -# -# Set a standard chain to enable established and related connections -# -setcontinue() # $1 = name of chain -{ - run_iptables -A $1 -m state --state ESTABLISHED,RELATED -j ACCEPT -} - -# -# Flush one of the Mangle table chains -# -flushmangle() # $1 = name of chain -{ - run_iptables -t mangle -F $1 -} - -# -# Flush and delete all user-defined chains in the filter table -# -deleteallchains() { - run_iptables -F - run_iptables -X -} - # # Generate a list of all network interfaces on the system # @@ -520,11 +488,12 @@ undo_routing() { # Restore the default route that was in place before the initial 'shorewall start' # restore_default_route() { + local result + if [ -z "$g_noroutes" -a -f ${VARDIR}/default_route ]; then local default_route default_route= local route - local result result=1 while read route ; do