diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index 164aa0ef0..eb4160bbf 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -61,6 +61,7 @@ our %EXPORT_TAGS = ( internal => [ qw( create_temp_script disable_script numeric_value numeric_value1 + normalize_hex hex_value in_hex in_hex2 @@ -811,6 +812,14 @@ sub numeric_value1 ( $ ) { use warnings; } +sub normalize_hex( $ ) { + my $val = shift; + + $val =~ s/^0x//; + $val =~ s/^0// while length $val > 1; + $val; +} + sub hex_value( $ ) { my $val = lc $_[0]; $val =~ s/^0x//; diff --git a/Shorewall/Perl/Shorewall/Tc.pm b/Shorewall/Perl/Shorewall/Tc.pm index 811d815de..aee7d03cc 100644 --- a/Shorewall/Perl/Shorewall/Tc.pm +++ b/Shorewall/Perl/Shorewall/Tc.pm @@ -981,7 +981,7 @@ sub process_tc_filter() { ( $device , my $devref ) = dev_by_number( $device ); - my $devnum = in_hex $devref->{number}; + my $devnum = in_hexp $devref->{number}; my $tcref = $tcclasses{$device};