Apply rate limiting in the nat table on nat+accept rules

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2018-08-23 14:07:10 -07:00
parent e5e427f278
commit 56780a5d1f
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10

View File

@ -3137,10 +3137,10 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
if ( $actiontype & ( NATRULE | NONAT ) && ! ( $actiontype & NATONLY ) ) {
#
# Either a DNAT, REDIRECT or ACCEPT+ rule or an Action with NAT;
# don't apply rate limiting twice
#
$rule .= join( '',
do_proto($proto, $ports, $sports),
do_ratelimit( $ratelimit, 'ACCEPT' ),
do_user( $user ) ,
do_test( $mark , $globals{TC_MASK} ) ,
do_connlimit( $connlimit ),
@ -3239,12 +3239,12 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
# - the destination IP will be the server IP ($dest) -- also done above
# - there will be no log level (we log NAT rules in the nat table rather than in the filter table).
# - the target will be ACCEPT.
# - don't apply rate limiting twice
#
unless ( $actiontype & NATONLY ) {
$rule = join( '',
$matches,
do_proto( $proto, $ports, $sports ),
do_ratelimit( $ratelimit, 'ACCEPT' ),
do_user $user,
do_test( $mark , $globals{TC_MASK} ),
do_condition( $condition , $chain ),