mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-18 20:30:43 +01:00
Back out part of TC change
This commit is contained in:
parent
5ce6d7d988
commit
d8c2845085
@ -814,7 +814,6 @@ sub numeric_value1 ( $ ) {
|
||||
|
||||
sub hex_value( $ ) {
|
||||
my $val = lc $_[0];
|
||||
$val =~ s/^0x//;
|
||||
return undef unless $val =~ /^[a-fA-F0-9]+$/;
|
||||
no warnings;
|
||||
oct '0x' . $val;
|
||||
@ -825,9 +824,8 @@ sub hex_value( $ ) {
|
||||
# Strip off leading 0x and superfluous leading zeros from a hex number
|
||||
#
|
||||
sub normalize_hex( $ ) {
|
||||
my $val = shift;
|
||||
my $val = lc shift;
|
||||
|
||||
$val =~ s/^0x//;
|
||||
$val =~ s/^0// while $val =~ /^0/ && length $val > 1;
|
||||
$val;
|
||||
}
|
||||
|
@ -252,7 +252,7 @@ sub process_tc_rule( ) {
|
||||
require_capability ('CONNMARK' , "CONNMARK Rules", '' ) if $connmark;
|
||||
|
||||
} else {
|
||||
fatal_error "Invalid MARK ($originalmark)" unless $mark =~ /^([0-9]+|0x[0-9a-f]+)$/ and $designator =~ /^([0-9]+|0x[0-9a-f]+)$/;
|
||||
fatal_error "Invalid MARK ($originalmark)" unless $mark =~ /^([0-9a-fA-F]+)$/ and $designator =~ /^([0-9a-fA-F]+)$/;
|
||||
|
||||
if ( $config{TC_ENABLED} eq 'Internal' || $config{TC_ENABLED} eq 'Shared' ) {
|
||||
$originalmark = join( ':', normalize_hex( $mark ), normalize_hex( $designator ) );
|
||||
@ -562,7 +562,7 @@ sub process_simple_device() {
|
||||
|
||||
my $id = $number; $number = in_hexp( $devnum | 0x100 );
|
||||
|
||||
emit "run_tc qdisc add dev $physical parent $number: handle $number: prio bands 3 priomap $config{TC_PRIOMAP}";
|
||||
emit "run_tc qdisc add dev $physical parent $id: handle $number: prio bands 3 priomap $config{TC_PRIOMAP}";
|
||||
} else {
|
||||
emit "run_tc qdisc add dev $physical root handle $number: prio bands 3 priomap $config{TC_PRIOMAP}";
|
||||
}
|
||||
@ -763,7 +763,7 @@ sub validate_tc_class( ) {
|
||||
( $device, my ($number, $subnumber, $rest ) ) = split /:/, $device, 4;
|
||||
fatal_error "Invalid INTERFACE:CLASS ($devclass)" if defined $rest;
|
||||
|
||||
if ( $device =~ /^(\d+|0x[\da-fA-F]+)$/ || ( $device =~ /^[\da-fA-F]+$/ && ! $tcdevices{$device} ) ) {
|
||||
if ( $device =~ /^[\da-fA-F]+$/ && ! $tcdevices{$device} ) {
|
||||
( $number , $classnumber ) = ( hex_value $device, hex_value $number );
|
||||
( $device , $devref) = dev_by_number( $number );
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user