diff --git a/Shorewall/Perl/Shorewall/Rules.pm b/Shorewall/Perl/Shorewall/Rules.pm index 7c9f68ea4..8d3149417 100644 --- a/Shorewall/Perl/Shorewall/Rules.pm +++ b/Shorewall/Perl/Shorewall/Rules.pm @@ -5485,6 +5485,14 @@ sub process_snat1( $$$$$$$$$$$$ ) { my $logaction; my $param; + # + # Handle early matches + # + if ( $inlinematches =~ s/^s*\+// ) { + $prerule = $inlinematches; + $inlinematches = ''; + } + if ( $action =~ /^MASQUERADE(\+)?(?:\((.+)\))?$/ ) { $target = 'MASQUERADE'; $actiontype = $builtin_target{$action = $target};