Alter logging behavior of Limit

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2017-03-05 13:03:57 -08:00
parent 356d3fa2dd
commit 137d4bcc90
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10

View File

@ -36,7 +36,7 @@ my $chainref = get_action_chain;
my @param = get_action_params(3);
my ( $level, $tag ) = get_action_logging;
@param = split /,/, $tag unless supplied( join '', @param );
@param = split( ',', $tag ), $tag = $param[0] unless supplied( join '', @param );
fatal_error 'Limit rules must include <set name>,<max connections>,<interval> as the log tag or as parameters' unless @param == 3;
@ -56,7 +56,7 @@ add_irule $chainref, recent => "--name $set --set";
if ( $level ne '' ) {
my $xchainref = new_chain 'filter' , "$chainref->{name}%";
log_irule_limit( $level, $xchainref, $param[0], 'DROP', [], $tag, 'add' , '' );
log_irule_limit( $level, $xchainref, '', 'DROP', [], $tag, 'add' , '' );
add_ijump $xchainref, j => 'DROP';
add_ijump $chainref, j => $xchainref, recent => "--name $set --update --seconds $param[2] --hitcount $count";
} else {