diff --git a/Shorewall/Perl/Shorewall/Chains.pm b/Shorewall/Perl/Shorewall/Chains.pm index ebbfc0857..dc8e79ec8 100644 --- a/Shorewall/Perl/Shorewall/Chains.pm +++ b/Shorewall/Perl/Shorewall/Chains.pm @@ -1682,8 +1682,8 @@ sub insert_irule( $$$$;@ ) { $ruleref->{comment} = shortlineinfo( $chainref->{origin} ) || $ruleref->{comment} || $comment; if ( $number >= @$rulesref ) { - $number = @$rulesref; push @$rulesref, $ruleref; + $number = @$rulesref; } else { splice( @$rulesref, $number, 0, $ruleref ); $number++;