mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-22 15:43:30 +01:00
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
93df86c90a
commit
649f73a360
@ -6413,7 +6413,7 @@ sub create_netfilter_load( $ ) {
|
|||||||
#
|
#
|
||||||
emit( 'exec 3>&-',
|
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..."',
|
'progress_message2 "Running $command..."',
|
||||||
'',
|
'',
|
||||||
|
@ -62,12 +62,14 @@ checkkernelversion() {
|
|||||||
#
|
#
|
||||||
# Start trace if first arg is "debug" or "trace"
|
# Start trace if first arg is "debug" or "trace"
|
||||||
#
|
#
|
||||||
|
g_debug_iptables=
|
||||||
|
|
||||||
if [ $# -gt 1 ]; then
|
if [ $# -gt 1 ]; then
|
||||||
if [ "x$1" = "xtrace" ]; then
|
if [ "x$1" = "xtrace" ]; then
|
||||||
set -x
|
set -x
|
||||||
shift
|
shift
|
||||||
elif [ "x$1" = "xdebug" ]; then
|
elif [ "x$1" = "xdebug" ]; then
|
||||||
DEBUG=Yes
|
g_debug_iptables=Yes
|
||||||
shift
|
shift
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -510,6 +510,19 @@ debug_restore_input() {
|
|||||||
qt1 $g_tool -t raw -P $chain ACCEPT
|
qt1 $g_tool -t raw -P $chain ACCEPT
|
||||||
done
|
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 -F
|
||||||
qt1 $g_tool -t filter -X
|
qt1 $g_tool -t filter -X
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user