From d8075f1b0189a8a788dd8c5b31f8dcbd4e652415 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 5 Feb 2008 10:49:07 -0800 Subject: cleanup on failed commit If commit of new policy fails, then remove all filters/qdisc. --- scripts/vyatta-qos.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/vyatta-qos.pl b/scripts/vyatta-qos.pl index 7680ea7..4ca96b8 100755 --- a/scripts/vyatta-qos.pl +++ b/scripts/vyatta-qos.pl @@ -76,7 +76,10 @@ sub update_interface { } $policy->commands($out, $interface); - close $out or die "Tc command failed: $!\n"; + if (! close $out && ! defined $debug) { + delete_interface($interface, $direction); + die "Tc commands failed\n"; + } exit 0; } } -- cgit v1.2.3