From 928c47217535abba73c20d6c7c930866d0f7e81a Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Fri, 13 May 2011 07:14:58 -0700 Subject: [PATCH] Issue warnings and ignore non-leaf class in tcfilters and tcrules Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Tc.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Shorewall/Perl/Shorewall/Tc.pm b/Shorewall/Perl/Shorewall/Tc.pm index ffa134593..70c30c86c 100644 --- a/Shorewall/Perl/Shorewall/Tc.pm +++ b/Shorewall/Perl/Shorewall/Tc.pm @@ -259,6 +259,11 @@ sub process_tc_rule( ) { fatal_error "Unknown Class ($originalmark)}" unless ( $device = $classids{$originalmark} ); fatal_error "IFB Classes may not be specified in tcrules" if @{$tcdevices{$device}{redirected}}; + unless ( $tcclasses{$device}{hex_value $designator}{leaf} ) { + warning_message "Non-leaf Class ($originalmark) - tcrule ignored"; + return; + } + if ( $dest eq '-' ) { $dest = $device; } else { @@ -1010,6 +1015,11 @@ sub process_tc_filter() { fatal_error "Unknown CLASS ($devclass)" unless $tcref && $tcref->{occurs}; fatal_error "Filters may not specify an occurring CLASS" if $tcref->{occurs} > 1; + unless ( $tcref->{leaf} ) { + warning_message "Filter specifying a non-leaf CLASS ($devnum:$class) ignored"; + return; + } + if ( $devref->{physical} ne $lastdevice ) { if ( $lastdevice ) { pop_indent;