mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-23 16:13:18 +01:00
Fix MARK bug in tcclasses
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@8495 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
e6d8eabbc1
commit
62b90cfa91
@ -1,5 +1,6 @@
|
|||||||
Changes in 4.1.9
|
Changes in 4.2.0-Beta1
|
||||||
|
|
||||||
|
1) Fix handling of firewall marks.
|
||||||
|
|
||||||
Changes in 4.1.8
|
Changes in 4.1.8
|
||||||
|
|
||||||
|
@ -77,7 +77,10 @@ Migration Issues.
|
|||||||
|
|
||||||
Problems Corrected in Shorewall 4.2.0 Beta 1
|
Problems Corrected in Shorewall 4.2.0 Beta 1
|
||||||
|
|
||||||
None.
|
1) Previously, Shorewall was generating an incorrect tc filter when
|
||||||
|
MARK values were used in /etc/shorewall/tcclasses (the filter
|
||||||
|
matched when the mark value was equal to the minor class ID rather
|
||||||
|
than the contents of the MARK column).
|
||||||
|
|
||||||
Other Changes in Shoreall 4.2.0 Beta 1.
|
Other Changes in Shoreall 4.2.0 Beta 1.
|
||||||
|
|
||||||
|
@ -476,7 +476,7 @@ sub validate_tc_class( $$$$$$ ) {
|
|||||||
$tcclasses{$device} = {} unless $tcclasses{$device};
|
$tcclasses{$device} = {} unless $tcclasses{$device};
|
||||||
my $tcref = $tcclasses{$device};
|
my $tcref = $tcclasses{$device};
|
||||||
|
|
||||||
my $markval;
|
my $markval = 0;
|
||||||
|
|
||||||
if ( $mark ne '-' ) {
|
if ( $mark ne '-' ) {
|
||||||
if ( $devref->{classify} ) {
|
if ( $devref->{classify} ) {
|
||||||
@ -497,7 +497,8 @@ sub validate_tc_class( $$$$$$ ) {
|
|||||||
$tcref->{$classnumber} = { tos => [] ,
|
$tcref->{$classnumber} = { tos => [] ,
|
||||||
rate => convert_rate( $full, $rate, 'RATE' ) ,
|
rate => convert_rate( $full, $rate, 'RATE' ) ,
|
||||||
ceiling => convert_rate( $full, $ceil, 'CEIL' ) ,
|
ceiling => convert_rate( $full, $ceil, 'CEIL' ) ,
|
||||||
priority => $prio eq '-' ? 1 : $prio
|
priority => $prio eq '-' ? 1 : $prio ,
|
||||||
|
mark => $markval
|
||||||
};
|
};
|
||||||
|
|
||||||
$tcref = $tcref->{$classnumber};
|
$tcref = $tcref->{$classnumber};
|
||||||
@ -769,11 +770,12 @@ sub setup_traffic_shaping() {
|
|||||||
my $lastdevice = '';
|
my $lastdevice = '';
|
||||||
|
|
||||||
for my $class ( @tcclasses ) {
|
for my $class ( @tcclasses ) {
|
||||||
my ( $device, $mark ) = split /:/, $class;
|
my ( $device, $classnum ) = split /:/, $class;
|
||||||
my $devref = $tcdevices{$device};
|
my $devref = $tcdevices{$device};
|
||||||
my $tcref = $tcclasses{$device}{$mark};
|
my $tcref = $tcclasses{$device}{$classnum};
|
||||||
|
my $mark = $tcref->{mark};
|
||||||
my $devicenumber = $devref->{number};
|
my $devicenumber = $devref->{number};
|
||||||
my $classid = join( '', $devicenumber, ':', $mark);
|
my $classid = join( '', $devicenumber, ':', $classnum);
|
||||||
my $rate = "$tcref->{rate}kbit";
|
my $rate = "$tcref->{rate}kbit";
|
||||||
my $quantum = calculate_quantum $rate, calculate_r2q( $devref->{out_bandwidth} );
|
my $quantum = calculate_quantum $rate, calculate_r2q( $devref->{out_bandwidth} );
|
||||||
my $dev = chain_base $device;
|
my $dev = chain_base $device;
|
||||||
@ -793,7 +795,7 @@ sub setup_traffic_shaping() {
|
|||||||
|
|
||||||
emit ( "[ \$${dev}_mtu -gt $quantum ] && quantum=\$${dev}_mtu || quantum=$quantum",
|
emit ( "[ \$${dev}_mtu -gt $quantum ] && quantum=\$${dev}_mtu || quantum=$quantum",
|
||||||
"run_tc class add dev $device parent $devref->{number}:1 classid $classid htb rate $rate ceil $tcref->{ceiling}kbit prio $tcref->{priority} \$${dev}_mtu1 quantum \$quantum",
|
"run_tc class add dev $device parent $devref->{number}:1 classid $classid htb rate $rate ceil $tcref->{ceiling}kbit prio $tcref->{priority} \$${dev}_mtu1 quantum \$quantum",
|
||||||
"run_tc qdisc add dev $device parent $classid handle ${mark}: sfq perturb 10"
|
"run_tc qdisc add dev $device parent $classid handle ${classnum}: sfq perturb 10"
|
||||||
);
|
);
|
||||||
#
|
#
|
||||||
# add filters
|
# add filters
|
||||||
|
Loading…
Reference in New Issue
Block a user