mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-23 08:03:11 +01:00
Fix rule numbers in trace output
- Don't increment $number needlessly when not tracing Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
10df9d31c4
commit
bc8588a68e
@ -1682,14 +1682,16 @@ sub insert_irule( $$$$;@ ) {
|
|||||||
$ruleref->{comment} = shortlineinfo( $chainref->{origin} ) || $ruleref->{comment} || $comment;
|
$ruleref->{comment} = shortlineinfo( $chainref->{origin} ) || $ruleref->{comment} || $comment;
|
||||||
|
|
||||||
if ( $number >= @$rulesref ) {
|
if ( $number >= @$rulesref ) {
|
||||||
push @$rulesref, $ruleref;
|
#
|
||||||
|
# Avoid failure in spice if we insert beyond the end of the chain
|
||||||
|
#
|
||||||
$number = @$rulesref;
|
$number = @$rulesref;
|
||||||
|
push @$rulesref, $ruleref;
|
||||||
} else {
|
} else {
|
||||||
splice( @$rulesref, $number, 0, $ruleref );
|
splice( @$rulesref, $number, 0, $ruleref );
|
||||||
$number++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
trace( $chainref, 'I', $number, format_rule( $chainref, $ruleref ) ) if $debug;
|
trace( $chainref, 'I', ++$number, format_rule( $chainref, $ruleref ) ) if $debug;
|
||||||
|
|
||||||
$iprangematch = 0;
|
$iprangematch = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user