Fix 'Shared' traffic shaping

This commit is contained in:
Tom Eastep 2010-11-14 09:31:00 -08:00
parent 997a697a65
commit 0e5dc41d31

View File

@ -1331,7 +1331,6 @@ sub setup_traffic_shaping() {
validate_tc_class while read_a_line;
}
unless ( $config{TC_ENABLED} eq 'Shared' ) {
for my $device ( @tcdevices ) {
my $devref = $tcdevices{$device};
my $defmark = in_hexp ( $devref->{default} || 0 );
@ -1342,6 +1341,8 @@ sub setup_traffic_shaping() {
my $dev = chain_base( $device );
unless ( $config{TC_ENABLED} eq 'Shared' ) {
emit "if interface_is_up $device; then";
push_indent;
@ -1417,6 +1418,7 @@ sub setup_traffic_shaping() {
pop_indent;
emit "fi\n";
}
}
my $lastdevice = '';
@ -1447,6 +1449,7 @@ sub setup_traffic_shaping() {
my $priority = $tcref->{priority} << 8;
my $parent = in_hexp $tcref->{parent};
unless ( $config{TC_ENABLED} eq 'Shared' ) {
if ( $lastdevice ne $device ) {
if ( $lastdevice ) {
pop_indent;
@ -1497,16 +1500,16 @@ sub setup_traffic_shaping() {
save_progress_message_short qq(" TC Class $classid defined.");
emit '';
}
if ( $lastdevice ) {
pop_indent;
emit "fi\n";
}
}
}
process_tcfilters;
}
}
#
# Process a record in the secmarks file