Include a current time event in /proc/net/xt_recent/

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2013-07-12 07:14:22 -07:00
parent f99e20ee19
commit 89f16bdb37
2 changed files with 13 additions and 1 deletions

View File

@ -730,6 +730,11 @@ show_nfacct() {
}
show_events() {
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
fi
if [ $# -gt 0 ]; then
for event in $@ ; do
if [ -f /proc/net/xt_recent/$event ]; then

View File

@ -511,7 +511,9 @@ EOF
#
emit(
' run_refreshed_exit',
' do_iptables -N shorewall',
' do_iptables -N shorewall' );
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',
'else',
@ -533,6 +535,11 @@ EOF
emit<<"EOF";
run_start_exit
do_iptables -N shorewall
EOF
emit ( ' do_iptables -A shorewall -m recent --set --name \%CURRENTTIME' ) if have_capability 'RECENT_MATCH';
emit<<"EOF";
set_state Started $config_dir
my_pathname=\$(my_pathname)
[ \$my_pathname = \${VARDIR}/firewall ] || cp -f \$my_pathname \${VARDIR}/firewall