mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-21 10:18:58 +02:00
Correct mark range with shifted mask.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
e908473d29
commit
3f1aeb33be
@ -644,12 +644,13 @@ sub process_tc_rule( ) {
|
|||||||
$mask = numeric_value $mask;
|
$mask = numeric_value $mask;
|
||||||
|
|
||||||
my $increment = 1;
|
my $increment = 1;
|
||||||
|
my $shift = 0;
|
||||||
|
|
||||||
$increment <<= 1 until $increment & $mask;
|
$increment <<= 1, $shift++ until $increment & $mask;
|
||||||
|
|
||||||
$mask = in_hex $mask;
|
$mask = in_hex $mask;
|
||||||
|
|
||||||
my $marks = $mark1val - $markval + 1;
|
my $marks = ( ( $mark1val - $markval ) >> $shift ) + 1;
|
||||||
|
|
||||||
for ( my $packet = 0; $packet < $marks; $packet++, $markval += $increment ) {
|
for ( my $packet = 0; $packet < $marks; $packet++, $markval += $increment ) {
|
||||||
my $match = "-m statistic --mode nth --every $marks --packet $packet ";
|
my $match = "-m statistic --mode nth --every $marks --packet $packet ";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user