From cf4b54e762f041fe6ab05cd429bd94f68da926dd Mon Sep 17 00:00:00 2001 From: teastep Date: Thu, 6 Dec 2007 19:26:12 +0000 Subject: [PATCH] Remove some crudeness from the traffic shaping code git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@7838 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/Shorewall/Tc.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Shorewall-perl/Shorewall/Tc.pm b/Shorewall-perl/Shorewall/Tc.pm index 1398af88d..e07a2d691 100644 --- a/Shorewall-perl/Shorewall/Tc.pm +++ b/Shorewall-perl/Shorewall/Tc.pm @@ -324,21 +324,22 @@ sub validate_tc_device( $$$$ ) { fatal_error "Duplicate device ($device)" if $tcdevices{$device}; fatal_error "Invalid device name ($device)" if $device =~ /[:+]/; - $tcdevices{$device} = {}; - $tcdevices{$device}{in_bandwidth} = rate_to_kbit( $inband ) . 'kbit'; - $tcdevices{$device}{out_bandwidth} = rate_to_kbit( $outband ) . 'kbit'; - $tcdevices{$device}{classify} = 0; + my $classify = 0; if ( $options ne '-' ) { for my $option ( split /,/, $options ) { if ( $option eq 'classify' ) { - $tcdevices{$device}{classify} = 1; + $classify = 1; } else { fatal_error "Unknown device option ($option)"; } } } + $tcdevices{$device} = { in_bandwidth => rate_to_kbit( $inband ) . 'kbit' , + out_bandwidth => rate_to_kbit( $outband ) . 'kbit' , + classify => $classify }; + push @tcdevices, $device; progress_message " Tcdevice \"$currentline\" $done.";