summaryrefslogtreecommitdiff
path: root/scripts/vyatta-qos.pl
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-02-14 14:00:20 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-02-14 14:00:20 -0800
commitc2b36d99a7715e13df75d83cc63ce92cac0981dc (patch)
tree5d1edd171bc14821cfb40f8c11528c1e588a7e59 /scripts/vyatta-qos.pl
parent72728a87d04ab3027960f7667840e4d4f781bb7d (diff)
downloadvyatta-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/vyatta-qos.pl')
-rwxr-xr-xscripts/vyatta-qos.pl10
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;
}