forked from extern/shorewall_code
Apply rate limiting in the nat table on nat+accept rules
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
e5e427f278
commit
56780a5d1f
@ -3137,10 +3137,10 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
if ( $actiontype & ( NATRULE | NONAT ) && ! ( $actiontype & NATONLY ) ) {
|
if ( $actiontype & ( NATRULE | NONAT ) && ! ( $actiontype & NATONLY ) ) {
|
||||||
#
|
#
|
||||||
# Either a DNAT, REDIRECT or ACCEPT+ rule or an Action with NAT;
|
# Either a DNAT, REDIRECT or ACCEPT+ rule or an Action with NAT;
|
||||||
# don't apply rate limiting twice
|
|
||||||
#
|
#
|
||||||
$rule .= join( '',
|
$rule .= join( '',
|
||||||
do_proto($proto, $ports, $sports),
|
do_proto($proto, $ports, $sports),
|
||||||
|
do_ratelimit( $ratelimit, 'ACCEPT' ),
|
||||||
do_user( $user ) ,
|
do_user( $user ) ,
|
||||||
do_test( $mark , $globals{TC_MASK} ) ,
|
do_test( $mark , $globals{TC_MASK} ) ,
|
||||||
do_connlimit( $connlimit ),
|
do_connlimit( $connlimit ),
|
||||||
@ -3239,12 +3239,12 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
# - the destination IP will be the server IP ($dest) -- also done above
|
# - 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).
|
# - 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.
|
# - the target will be ACCEPT.
|
||||||
|
# - don't apply rate limiting twice
|
||||||
#
|
#
|
||||||
unless ( $actiontype & NATONLY ) {
|
unless ( $actiontype & NATONLY ) {
|
||||||
$rule = join( '',
|
$rule = join( '',
|
||||||
$matches,
|
$matches,
|
||||||
do_proto( $proto, $ports, $sports ),
|
do_proto( $proto, $ports, $sports ),
|
||||||
do_ratelimit( $ratelimit, 'ACCEPT' ),
|
|
||||||
do_user $user,
|
do_user $user,
|
||||||
do_test( $mark , $globals{TC_MASK} ),
|
do_test( $mark , $globals{TC_MASK} ),
|
||||||
do_condition( $condition , $chain ),
|
do_condition( $condition , $chain ),
|
||||||
|
Loading…
Reference in New Issue
Block a user