forked from extern/shorewall_code
More fixes for TC
This commit is contained in:
parent
4c27c68c43
commit
46e2a02fe4
@ -813,6 +813,7 @@ 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;
|
||||
|
@ -255,6 +255,7 @@ sub process_tc_rule( ) {
|
||||
fatal_error "Invalid MARK ($originalmark)" unless $mark =~ /^([0-9]+|0x[0-9a-f]+)$/ and $designator =~ /^([0-9]+|0x[0-9a-f]+)$/;
|
||||
|
||||
if ( $config{TC_ENABLED} eq 'Internal' || $config{TC_ENABLED} eq 'Shared' ) {
|
||||
$originalmark =~ s/0x//g;
|
||||
fatal_error "Unknown Class ($originalmark)}" unless ( $device = $classids{$originalmark} );
|
||||
fatal_error "IFB Classes may not be specified in tcrules" if @{$tcdevices{$device}{redirected}};
|
||||
}
|
||||
@ -763,7 +764,6 @@ sub validate_tc_class( ) {
|
||||
fatal_error "Invalid INTERFACE:CLASS ($devclass)" if defined $rest;
|
||||
|
||||
if ( $device =~ /^(\d+|0x[\da-fA-F]+)$/ ) {
|
||||
$device =~ s/^0x//;
|
||||
( $number , $classnumber ) = ( hex_value $device, hex_value $number );
|
||||
( $device , $devref) = dev_by_number( $number );
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user