From e66d491f111483a19d045a5e7b39fce79cc0d8c8 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Mon, 2 May 2011 09:52:31 -0700 Subject: [PATCH] Correct patch for > 9 interfaces with tcfilters --- Shorewall/Perl/Shorewall/Config.pm | 9 +++++++++ Shorewall/Perl/Shorewall/Tc.pm | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index 4552d8068..79a419014 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};