diff --git a/Shorewall/Actions/action.IfEvent b/Shorewall/Actions/action.IfEvent index b40d5a96d..5f245ed22 100644 --- a/Shorewall/Actions/action.IfEvent +++ b/Shorewall/Actions/action.IfEvent @@ -107,6 +107,11 @@ if ( $command & $REAP_OPT ) { $duration .= '--rttl ' if $command & $TTL_OPT; +if ( ( $targets{$action} || 0 ) & NATRULE ) { + perl_action_helper( "${action}-", "-m recent --rcheck ${duration}--hitcount $hitcount" ); + $action = 'ACCEPT'; +} + if ( $command & $RESET_CMD ) { require_capability 'MARK_ANYWHERE', '"reset"', 's'; diff --git a/Shorewall/Actions/action.ResetEvent b/Shorewall/Actions/action.ResetEvent index a68726f6d..61ba27fef 100644 --- a/Shorewall/Actions/action.ResetEvent +++ b/Shorewall/Actions/action.ResetEvent @@ -41,6 +41,11 @@ fatal_error "Invalid Src or Dest ($destination)" unless $destination =~ /^(?:src set_action_disposition( $disposition) if supplied $disposition; set_action_name_to_caller; +if ( ( $targets{$action} || 0 ) & NATRULE ) { + perl_action_helper( "${action}-", "" ); + $action = 'ACCEPT'; +} + if ( $destination eq 'dst' ) { perl_action_helper( $action, '', '', "-m recent --name $event --remove --rdest" ); } else { diff --git a/Shorewall/Actions/action.SetEvent b/Shorewall/Actions/action.SetEvent index 503a4e889..1fb1e7fcd 100644 --- a/Shorewall/Actions/action.SetEvent +++ b/Shorewall/Actions/action.SetEvent @@ -37,6 +37,11 @@ fatal_error "Invalid Src or Dest ($destination)" unless $destination =~ /^(?:src set_action_disposition( $disposition) if supplied $disposition; set_action_name_to_caller; +if ( ( $targets{$action} || 0 ) & NATRULE ) { + perl_action_helper( "${action}-", "" ); + $action = 'ACCEPT'; +} + if ( $destination eq 'dst' ) { perl_action_helper( $action, '', '', "-m recent --name $event --set --rdest" ); } else {