diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index ef3d03b12..164aa0ef0 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -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; diff --git a/Shorewall/Perl/Shorewall/Tc.pm b/Shorewall/Perl/Shorewall/Tc.pm index a4ebc481a..811d815de 100644 --- a/Shorewall/Perl/Shorewall/Tc.pm +++ b/Shorewall/Perl/Shorewall/Tc.pm @@ -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 {