From 10aef23ab18ea8385c6ae449d969fcd626103d7e Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Sun, 28 Jun 2020 11:03:04 -0700 Subject: [PATCH] Correct handling of ";;+" in the snat file Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Rules.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Shorewall/Perl/Shorewall/Rules.pm b/Shorewall/Perl/Shorewall/Rules.pm index 64dfc2c13..cc947761a 100644 --- a/Shorewall/Perl/Shorewall/Rules.pm +++ b/Shorewall/Perl/Shorewall/Rules.pm @@ -5572,6 +5572,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};