From 56c205f7070a541555c81bb8546d0a7ba4359e60 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 20 Jul 2010 17:01:11 -0700 Subject: Fix setting of actions on boot The redirect and mirror actions were incorrectly using an end: node, so they would fail on boot when combined with ifb. --- interface-templates/mirror/node.def | 5 ++--- interface-templates/redirect/node.def | 3 ++- scripts/vyatta-qos.pl | 12 ++++++++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/interface-templates/mirror/node.def b/interface-templates/mirror/node.def index bb83c6f..b4b5b38 100644 --- a/interface-templates/mirror/node.def +++ b/interface-templates/mirror/node.def @@ -14,6 +14,5 @@ commit:expression: $VAR(../redirect) == ""; \ commit:expression: $VAR(../traffic-policy/in) == ""; \ "interface $VAR(../@) : can not use ingress policy and mirror on $IFNAME" -end: /opt/vyatta/sbin/vyatta-qos.pl --update-action $IFNAME - - +update: /opt/vyatta/sbin/vyatta-qos.pl --update-action $IFNAME +delete: /opt/vyatta/sbin/vyatta-qos.pl --delete-action $IFNAME diff --git a/interface-templates/redirect/node.def b/interface-templates/redirect/node.def index ac2ad7e..9dfbf09 100644 --- a/interface-templates/redirect/node.def +++ b/interface-templates/redirect/node.def @@ -14,4 +14,5 @@ commit:expression: $VAR(../mirror) == "";\ commit:expression: $VAR(../traffic-policy/in) == ""; \ "interface $VAR(../@) : can not use ingress policy and redirect on $IFNAME" -end: /opt/vyatta/sbin/vyatta-qos.pl --update-action $IFNAME +update: /opt/vyatta/sbin/vyatta-qos.pl --update-action $IFNAME +delete: /opt/vyatta/sbin/vyatta-qos.pl --delete-action $IFNAME diff --git a/scripts/vyatta-qos.pl b/scripts/vyatta-qos.pl index b232ae2..9655371 100755 --- a/scripts/vyatta-qos.pl +++ b/scripts/vyatta-qos.pl @@ -303,6 +303,12 @@ sub apply_action{ unless($ingress); } +sub delete_action { + foreach my $dev (@_) { + system("sudo tc qdisc del dev $dev parent ffff: 2>/dev/null"); + } +} + sub usage { print < \@applyPolicy, "update-action=s" => \$updateAction, - + "delete-action=s" => \$deleteAction, ) or usage(); delete_interface(@deleteInterface) if ( @deleteInterface == 1); @@ -345,3 +352,4 @@ delete_policy(@deletePolicy) if ( @deletePolicy ); apply_policy(@applyPolicy) if ( @applyPolicy ); update_action($updateAction) if ( $updateAction ); +delete_action($deleteAction) if ( $deleteAction ); -- cgit v1.2.3