Tweak do_ratelimit()

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2018-07-03 14:22:30 -07:00
parent 5a599552f2
commit 93f0183550
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10

View File

@ -5417,7 +5417,7 @@ sub do_ratelimit( $$ ) {
if ( supplied $11 ) {
fatal_error "Invalid Burst ($11)" unless $11;
$limit .= $match eq 'limit' ? " --limit-burst $11 " : "--hashlimit-burst $11 ";
$limit .= $match eq 'limit' ? "--limit-burst $11 " : "--hashlimit-burst $11 ";
}
@ -5430,7 +5430,7 @@ sub do_ratelimit( $$ ) {
if ( supplied $2 ) {
my $vlsm = numeric_value($2);
fatal_error "Invalid VLSM ($2)" unless $vlsm and $vlsm <= ( $family == F_IPV4 ? VLSMv4 : VLSMv6 );
$limit .= $rate =~ /^s:/ ? " --hashlimit-srcmask $vlsm" : " --hashlimit-dstmask $vlsm";
$limit .= $mode eq 'srcip' ? " --hashlimit-srcmask $vlsm" : " --hashlimit-dstmask $vlsm";
}
if ( supplied $5 ) {
@ -5445,7 +5445,6 @@ sub do_ratelimit( $$ ) {
}
$limit .= " --hashlimit-mode $mode" if $mode;
$limit .= ' ' unless $limit =~ / $/;
$units = $10;
} else {
fatal_error "Invalid rate ($rate)";
@ -5460,8 +5459,9 @@ sub do_ratelimit( $$ ) {
}
$limit .= " --hashlimit-htable-expire $expire ";
} else {
$limit .= ' ';
}
}
$limit;