diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-02-14 14:00:20 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-02-14 14:00:20 -0800 |
commit | c2b36d99a7715e13df75d83cc63ce92cac0981dc (patch) | |
tree | 5d1edd171bc14821cfb40f8c11528c1e588a7e59 /scripts | |
parent | 72728a87d04ab3027960f7667840e4d4f781bb7d (diff) | |
download | vyatta-cfg-qos-c2b36d99a7715e13df75d83cc63ce92cac0981dc.tar.gz vyatta-cfg-qos-c2b36d99a7715e13df75d83cc63ce92cac0981dc.zip |
if error occurs in qos processing display commands
If the command to tc doesn't work, then reprint to standard out
for diagnostic. Also, fix use of sudo in delete of qdisc.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/vyatta-qos.pl | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/vyatta-qos.pl b/scripts/vyatta-qos.pl index 2aef09c..5996e92 100755 --- a/scripts/vyatta-qos.pl +++ b/scripts/vyatta-qos.pl @@ -65,8 +65,7 @@ sub delete_interface { if ($direction eq "out" ) { # delete old qdisc - will give error if no policy in place - system("tc qdisc del dev $interface root 2>/dev/null"); - system("tc filter del dev $interface 2>/dev/null"); + qx(sudo tc qdisc del dev "$interface" root 2>/dev/null); } } @@ -98,7 +97,12 @@ sub update_interface { $policy->commands($out, $interface); if (! close $out && ! defined $debug) { delete_interface($interface, $direction); - die "Tc commands failed\n"; + + # replay commands to stdout + open $out, '>-'; + $policy->commands($out, $interface); + close $out; + die "Conversion of configuration to tc command error\n"; } exit 0; } |