From 57288086bf55a6f520d985f8762001cff5d0b7c3 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Wed, 27 Jan 2016 12:55:21 -0800 Subject: [PATCH] Unify TRACK_RULES handling Signed-off-by: Tom Eastep --- 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 f7b3a0681..79ac87943 100644 --- a/Shorewall/Perl/Shorewall/Chains.pm +++ b/Shorewall/Perl/Shorewall/Chains.pm @@ -1250,7 +1250,7 @@ sub set_irule_comment( $$ ) { my ( $chainref, $ruleref ) = @_; if ( $config{TRACK_RULES} eq 'Yes' ) { - $ruleref->{comment} = shortlineinfo( $chainref->{origin} ) || $comment; + $ruleref->{comment} = $ruleref->{origin} || $comment; } else { $ruleref->{comment} = $comment; } @@ -1489,7 +1489,7 @@ sub create_irule( $$$;@ ) { ( $target, my $targetopts ) = split ' ', $target, 2; - my $ruleref = { matches => [] , origin => shortlineinfo( '' ) }; + my $ruleref = { matches => [] , origin => shortlineinfo( $chainref->{origin} ) }; $ruleref->{mode} = ( $ruleref->{cmdlevel} = $chainref->{cmdlevel} ) ? CMD_MODE : CAT_MODE; @@ -1684,7 +1684,7 @@ sub insert_irule( $$$$;@ ) { my ( $chainref, $jump, $target, $number, @matches ) = @_; my $rulesref = $chainref->{rules}; - my $ruleref = { origin => shortlineinfo( '' ) }; + my $ruleref = { origin => shortlineinfo( $chainref->{origin} ) }; $ruleref->{mode} = ( $ruleref->{cmdlevel} = $chainref->{cmdlevel} ) ? CMD_MODE : CAT_MODE; @@ -2446,7 +2446,7 @@ sub add_ijump_internal( $$$$$;@ ) { $fromref->{complete} = 1 if $jump eq 'g' || $terminating{$to}; } - $ruleref->{origin} ||= $origin; + $ruleref->{origin} = $origin if $origin; $expandports ? handle_port_ilist( $fromref, $ruleref, 1 ) : push_irule( $fromref, $ruleref ); }