From 579910fdb87f24ac86753b688004d47f7d9d559e Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Wed, 26 Oct 2016 14:40:16 -0700 Subject: [PATCH] Fix MASQUERADE+ Handling Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Rules.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Rules.pm b/Shorewall/Perl/Shorewall/Rules.pm index dad0c7c10..f5dda3bd2 100644 --- a/Shorewall/Perl/Shorewall/Rules.pm +++ b/Shorewall/Perl/Shorewall/Rules.pm @@ -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 ); }