From 61ac08dc7fd1fbc0202b607b5535777634d50687 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Fri, 14 Dec 2018 14:16:26 -0800 Subject: [PATCH] Correct handling of netmask when two rates are specified in the RATE col. Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Chains.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Chains.pm b/Shorewall/Perl/Shorewall/Chains.pm index 50918dd6c..198c39523 100644 --- a/Shorewall/Perl/Shorewall/Chains.pm +++ b/Shorewall/Perl/Shorewall/Chains.pm @@ -5350,8 +5350,8 @@ sub do_ratelimit( $$ ) { my @rates = split_list3 $rates, 'rate'; if ( @rates == 2 ) { - $rates[0] = 's:' . $rates[0] unless $rates[0] =~ /^s:/; - $rates[1] = 'd:' . $rates[1] unless $rates[1] =~ /^d:/; + $rates[0] = 's:' . $rates[0] unless $rates[0] =~ /^s(?:\/\d+)?:/; + $rates[1] = 'd:' . $rates[1] unless $rates[1] =~ /^d(?:\/\d+)?:/; } elsif ( @rates > 2 ) { fatal error "Only two rates may be specified"; }