Fix MASQUERADE+ Handling

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2016-10-26 14:40:16 -07:00
parent 21877d5fcb
commit 579910fdb8
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10

View File

@ -5357,11 +5357,11 @@ sub process_snat1( $$$$$$$$$$$$ ) {
my $interfaces;
my $normalized_action;
if ( $action =~ /^MASQUERADE(\+)?\((.+)\)$/ ) {
if ( $action =~ /^MASQUERADE(\+)?(?:\((.+)\))?$/ ) {
$target = 'MASQUERADE';
$actiontype = $builtin_target{$action = $target};
$pre_nat = $1;
$addresses = $2;
$addresses = ( $2 || '' );
$options = 'random' if $addresses =~ s/:?random$//;
} elsif ( $action =~ /^SNAT(\+)?\((.+)\)$/ ) {
$pre_nat = $1;
@ -5382,7 +5382,7 @@ sub process_snat1( $$$$$$$$$$$$ ) {
$pre_nat = ( $target =~ s/\+$// );
$actiontype = $targets{$target};
$actiontype = ( $targets{$target} || 0 );
fatal_error "Invalid ACTION ($action)" unless $actiontype & ( ACTION | INLINE );
}