Modify the Event actions to handle NAT rules

- Separate DNAT and REDIRECT into DNAT- and REDIRECT- plus ACCEPT

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2017-09-08 09:47:12 -07:00
parent 1065c2951b
commit 41ea3bdeda
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10
3 changed files with 15 additions and 0 deletions

View File

@ -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';

View File

@ -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 {

View File

@ -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 {