From 5f18bd9d54986c80cd20dfb191f6c3dbad5c63d7 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 7 Mar 2008 15:35:34 -0800 Subject: clear old policy before applying new QOS Need to cleanup old qdisc/class/filters before applying new one. Bugfix: 2932 --- scripts/vyatta-qos.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/vyatta-qos.pl b/scripts/vyatta-qos.pl index 0f00646..63e2661 100755 --- a/scripts/vyatta-qos.pl +++ b/scripts/vyatta-qos.pl @@ -88,6 +88,9 @@ sub update_interface { if ( $config->exists("$type $name") ) { my $shaper = make_policy($config, $type, $name); + # Remove old policy + delete_interface($interface, $direction); + # When doing debugging just echo the commands my $out; if (defined $debug) { @@ -163,10 +166,8 @@ sub update_policy { $config->setLevel("interfaces ethernet"); foreach my $interface ( $config->listNodes() ) { foreach my $direction ( $config->listNodes("$interface qos-policy") ) { - if ($config->returnValue("$interface qos-policy $direction") eq $name) { - delete_interface($interface, $direction); + if ($config->returnValue("$interface qos-policy $direction") eq $name) update_interface($interface, $direction, $name); - } } } } -- cgit v1.2.3