diff --git a/Shorewall-core/lib.cli b/Shorewall-core/lib.cli index cd4ecc165..99c836149 100644 --- a/Shorewall-core/lib.cli +++ b/Shorewall-core/lib.cli @@ -730,9 +730,14 @@ show_nfacct() { } show_events() { + local file + local base + if [ -f /proc/net/xt_recent/%CURRENTTIME ]; then echo -127.0.0.1 > /proc/net/xt_recent/%CURRENTTIME echo +127.0.0.1 > /proc/net/xt_recent/%CURRENTTIME + echo Current time: $(cat /proc/net/xt_recent/%CURRENTTIME | cut -d ' ' -f 5 -) + echo fi if [ $# -gt 0 ]; then @@ -747,9 +752,13 @@ show_events() { done else for file in /proc/net/xt_recent/*; do - echo $(basename $file) - cat $file - echo + base=$(basename $file) + + if [ $base != %CURRENTTIME ]; then + echo $(basename $file) + cat $file + echo + fi done fi } diff --git a/Shorewall/Perl/Shorewall/Compiler.pm b/Shorewall/Perl/Shorewall/Compiler.pm index 598377442..7d8b38a10 100644 --- a/Shorewall/Perl/Shorewall/Compiler.pm +++ b/Shorewall/Perl/Shorewall/Compiler.pm @@ -512,7 +512,9 @@ EOF emit( ' run_refreshed_exit', ' do_iptables -N shorewall' ); - emit ( ' do_iptables -A shorewall -m recent --set --name \%CURRENTTIME' ) if have_capability 'RECENT_MATCH'; + + emit ( ' do_iptables -A shorewall -m recent --set --name %CURRENTTIME' ) if have_capability 'RECENT_MATCH'; + emit( " set_state Started $config_dir", ' [ $0 = ${VARDIR}/firewall ] || cp -f $(my_pathname) ${VARDIR}/firewall', @@ -537,7 +539,7 @@ EOF do_iptables -N shorewall EOF - emit ( ' do_iptables -A shorewall -m recent --set --name \%CURRENTTIME' ) if have_capability 'RECENT_MATCH'; + emit ( ' do_iptables -A shorewall -m recent --set --name %CURRENTTIME' ) if have_capability 'RECENT_MATCH'; emit<<"EOF"; set_state Started $config_dir