From b03e3b94ef5a54fc2d658ef355c543d4241005a6 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Tue, 15 Feb 2011 19:24:14 -0800 Subject: [PATCH] More optimization fixes --- Shorewall/Perl/Shorewall/Chains.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Chains.pm b/Shorewall/Perl/Shorewall/Chains.pm index 2dbc83ba2..a3bfc95eb 100644 --- a/Shorewall/Perl/Shorewall/Chains.pm +++ b/Shorewall/Perl/Shorewall/Chains.pm @@ -1676,7 +1676,7 @@ sub replace_references( $$ ) { my $rule = 0; for ( @{$fromref->{rules}} ) { $rule++; - if ( s/ -([jg]) $name($|\s)/ -$1 ${target}$2/ ) { + if ( s/ -([jg]) $name(.*$)/ -$1 ${target}$2/ ) { add_reference ( $fromref, $tableref->{$target} ); $count++; trace( $fromref, 'R', $rule, $_ ) if $debug; @@ -1685,7 +1685,7 @@ sub replace_references( $$ ) { } } - delete $tableref->{target}{references}{$chainref->{name}}; + delete $tableref->{$target}{references}{$chainref->{name}}; } else { # # The target is a builtin -- we must use '-j' @@ -1695,7 +1695,7 @@ sub replace_references( $$ ) { my $rule = 0; for ( @{$fromref->{rules}} ) { $rule++; - if ( s/ -[jg] $name($|\s)/ -j ${target}$1/ ) { + if ( s/ -[jg] $name(.*$)/ -j ${target}$1/ ) { $count++ ; trace( $fromref, 'R', $rule, $_ ) if $debug; } @@ -1896,7 +1896,7 @@ sub optimize_level4( $$ ) { # # Chain has a single rule # - if ( $firstrule =~ /^-A -[jg] ([^\s])(\s+-m comment .*)?\s*$/ ) { + if ( $firstrule =~ /^-A -[jg] ([^\s]+)(\s+-m comment .*)?\s*$/ ) { # # Easy case -- the rule is a simple jump #