Fix Limit problem

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5591 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-03-20 01:39:16 +00:00
parent 1b1911a2d0
commit e13b9d634e

View File

@ -590,6 +590,8 @@ sub process_actions3 () {
my @tag = split /,/, $tag;
my $count = $tag[1] + 1;
fatal_error 'Limit rules must include <set name>,<max connections>,<interval> as the log tag' unless @tag == 3;
add_rule $chainref, '-m recent --name $tag[0] --set';
@ -598,9 +600,9 @@ sub process_actions3 () {
my $xchainref = new_chain 'filter' , "$chainref->{name}%";
log_rule_limit $level, $xchainref, $tag[0], 'DROP', '', '', 'add', '';
add_rule $xchainref, '-j DROP';
add_rule $chainref, "-m recent --name $tag[0] --update --seconds $tag[2] --hitcount $(( $tag[1] + 1 )) -j $chainref->{name}%";
add_rule $chainref, "-m recent --name $tag[0] --update --seconds $tag[2] --hitcount $count -j $chainref->{name}%";
} else {
add_rule $chainref, "-m recent --update --name $tag[0] --seconds $tag[2] --hitcount $(( $tag[1] + 1 )) -j DROP";
add_rule $chainref, "-m recent --update --name $tag[0] --seconds $tag[2] --hitcount $count -j DROP";
}
add_rule $chainref, '-j ACCEPT';