From db6a7276ec6f40fb2479792aaa91dac111481d72 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Thu, 7 Jun 2012 14:11:44 -0700 Subject: [PATCH] Don't optimize chains with commands Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Chains.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Shorewall/Perl/Shorewall/Chains.pm b/Shorewall/Perl/Shorewall/Chains.pm index feb83f880..b9334228c 100644 --- a/Shorewall/Perl/Shorewall/Chains.pm +++ b/Shorewall/Perl/Shorewall/Chains.pm @@ -707,7 +707,9 @@ sub macro_comment( $ ) { # Functions to manipulate cmdlevel # sub incr_cmd_level( $ ) { - $_[0]->{cmdlevel}++; + my $chain = $_[0]; + $chain->{cmdlevel}++; + $chain->{optflags} |= ( DONT_OPTIMIZE | DONT_MOVE ); } sub decr_cmd_level( $ ) { @@ -1021,6 +1023,7 @@ sub add_commands ( $$;@ ) { } for @_; $chainref->{referenced} = 1; + $chainref->{optflags} |= ( DONT_OPTIMIZE | DONT_MOVE ); } #