Swicth from postincrement to preincrement when bumping 'filterpri'.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-09-17 10:46:31 -07:00
parent abbd1b2c35
commit e14f5e5199
3 changed files with 23 additions and 25 deletions

View File

@ -983,7 +983,7 @@ sub validate_tc_device( ) {
mtu => $mtu,
mpu => $mpu,
tsize => $tsize,
filterpri => 1,
filterpri => 0,
} ,
push @tcdevices, $device;
@ -1422,11 +1422,11 @@ sub process_tc_filter() {
my ( $prio, $filterpri ) = ( undef, $devref->{filterpri} );
if ( $priority eq '-' ) {
$prio = $filterpri++;
$prio = ++$filterpri;
fatal_error "Filter priority overflow" if $prio > 65535;
} else {
$prio = validate_filter_priority( $priority, 'filter' );
$filterpri = $prio + 1 if $prio >= $filterpri;
$filterpri = $prio if $prio > $filterpri;
}
$devref->{filterpri} = $filterpri;

View File

@ -205,22 +205,21 @@
<itemizedlist>
<listitem>
<para>For Shorewall versions prior to 4.5.8, all filters have
<para>For Shorewall versions prior to 4.5.8 - all filters have
priority 10.</para>
</listitem>
<listitem>
<para>For Shorewall 4.5.8 and later, the compiler maintains a
<firstterm>high-water priority</firstterm> that has an initial
value of 1. When a filter has no
<para>For Shorewall 4.5.8 and later - for each device, the
compiler maintains a <firstterm>high-water priority</firstterm>
with an initial value of 0. When a filter has no
<replaceable>priority</replaceable>, the high-water priority is
assigned to the filter and the high-wanter priority is
incremented by 1. When a <replaceable>priority</replaceable>
greater than or equal than the high-water priority is entered in
this column, the high-water priority is set to the specified
<replaceable>priority</replaceable> plus 1. An attempt to assign
a priority value greater than 65535 (explicitly or implicitly),
an error is raised.</para>
incremented by 1 and assigned to the filter. When a
<replaceable>priority</replaceable> greater than the high-water
priority is entered in this column, the high-water priority is
set to the specified <replaceable>priority</replaceable>. An
attempt to assign a priority value greater than 65535
(explicitly or implicitly) raises an error.</para>
</listitem>
</itemizedlist>

View File

@ -199,22 +199,21 @@
<itemizedlist>
<listitem>
<para>For Shorewall versions prior to 4.5.8, all filters have
<para>For Shorewall versions prior to 4.5.8 - all filters have
priority 11.</para>
</listitem>
<listitem>
<para>For Shorewall 4.5.8 and later, the compiler maintains a
<firstterm>high-water priority</firstterm> that has an initial
value of 1. When a filter has no
<para>For Shorewall 4.5.8 and later - for each device, the
compiler maintains a <firstterm>high-water priority</firstterm>
with an initial value of 0. When a filter has no
<replaceable>priority</replaceable>, the high-water priority is
assigned to the filter and the high-wanter priority is
incremented by 1. When a <replaceable>priority</replaceable>
greater than or equal than the high-water priority is entered in
this column, the high-water priority is set to the specified
<replaceable>priority</replaceable> plus 1. An attempt to assign
a priority value greater than 65535 (explicitly or implicitly),
an error is raised.</para>
incremented by 1 and assigned to the filter. When a
<replaceable>priority</replaceable> greater than the high-water
priority is entered in this column, the high-water priority is
set to the specified <replaceable>priority</replaceable>. An
attempt to assign a priority value greater than 65535
(explicitly or implicitly) raises an error.</para>
</listitem>
</itemizedlist>