From 09c00cf42590117e07d9c6c11edeafdc8e9b4ebf Mon Sep 17 00:00:00 2001 From: Tom Eastep <teastep@shorewall.net> Date: Sun, 1 Jul 2012 08:27:07 -0700 Subject: [PATCH] Don't print phoney progress message - The 'Setting up Traffic Shaping' progress message was being issued when traffic shaping was not enabled. Signed-off-by: Tom Eastep <teastep@shorewall.net> --- Shorewall/Perl/Shorewall/Tc.pm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Tc.pm b/Shorewall/Perl/Shorewall/Tc.pm index 26632af3a..c5e07a62c 100644 --- a/Shorewall/Perl/Shorewall/Tc.pm +++ b/Shorewall/Perl/Shorewall/Tc.pm @@ -2031,13 +2031,15 @@ sub process_tc() { # Call the setup_${dev}_tc functions # sub setup_traffic_shaping() { - save_progress_message q("Setting up Traffic Control..."); + if ( @tcdevices ) { + save_progress_message q("Setting up Traffic Control..."); - for my $device ( @tcdevices ) { - my $interfaceref = known_interface( $device ); - my $dev = chain_base( $interfaceref ? $interfaceref->{physical} : $device ); + for my $device ( @tcdevices ) { + my $interfaceref = known_interface( $device ); + my $dev = chain_base( $interfaceref ? $interfaceref->{physical} : $device ); - emit "setup_${dev}_tc"; + emit "setup_${dev}_tc"; + } } } @@ -2157,7 +2159,7 @@ sub setup_tc() { append_file $globals{TC_SCRIPT}; } else { process_tcpri if $config{TC_ENABLED} eq 'Simple'; - setup_traffic_shaping unless $config{TC_ENABLED} eq 'Shared'; + setup_traffic_shaping if @tcdevices && $config{TC_ENABLED} ne 'Shared'; } if ( $config{TC_ENABLED} ) {