forked from extern/shorewall_code
Correct issues with debugging the generated script
a) Rename DEBUG to g_debug_iptablesb b) Clear all of the tables prior to handling iptables-restore input.
This commit is contained in:
parent
1d249567ed
commit
dff5136134
@ -6514,7 +6514,7 @@ sub create_netfilter_load( $ ) {
|
||||
#
|
||||
emit( 'exec 3>&-',
|
||||
'',
|
||||
'[ -n "$DEBUG" ] && command=debug_restore_input || command=$' . $UTILITY,
|
||||
'[ -n "$g_debug_iptables" ] && command=debug_restore_input || command=$' . $UTILITY,
|
||||
'',
|
||||
'progress_message2 "Running $command..."',
|
||||
'',
|
||||
|
@ -62,12 +62,14 @@ checkkernelversion() {
|
||||
#
|
||||
# Start trace if first arg is "debug" or "trace"
|
||||
#
|
||||
g_debug_iptables=
|
||||
|
||||
if [ $# -gt 1 ]; then
|
||||
if [ "x$1" = "xtrace" ]; then
|
||||
set -x
|
||||
shift
|
||||
elif [ "x$1" = "xdebug" ]; then
|
||||
DEBUG=Yes
|
||||
g_debug_iptables=Yes
|
||||
shift
|
||||
fi
|
||||
fi
|
||||
|
@ -510,6 +510,19 @@ debug_restore_input() {
|
||||
qt1 $g_tool -t raw -P $chain ACCEPT
|
||||
done
|
||||
|
||||
qt1 $g_tool -t rawpost -F
|
||||
qt1 $g_tool -t rawpost -X
|
||||
|
||||
for chain in POSTROUTING; do
|
||||
qt1 $g_tool -t rawpost -P $chain ACCEPT
|
||||
done
|
||||
|
||||
qt1 $g_tool -t nat -F
|
||||
qt1 $g_tool -t nat -X
|
||||
|
||||
for chain in PREROUTING POSTROUTING; do
|
||||
qt1 $g_tool -t nat -P $chain ACCEPT
|
||||
|
||||
qt1 $g_tool -t filter -F
|
||||
qt1 $g_tool -t filter -X
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user