diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-07-20 17:01:11 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-07-20 17:07:58 -0700 |
commit | 56c205f7070a541555c81bb8546d0a7ba4359e60 (patch) | |
tree | 70bc6af378ba01b1b59da398038c7b8b440b9f47 | |
parent | 4a97c98710323126bc0d36bbe4620162fb979a97 (diff) | |
download | vyatta-cfg-qos-56c205f7070a541555c81bb8546d0a7ba4359e60.tar.gz vyatta-cfg-qos-56c205f7070a541555c81bb8546d0a7ba4359e60.zip |
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.
-rw-r--r-- | interface-templates/mirror/node.def | 5 | ||||
-rw-r--r-- | interface-templates/redirect/node.def | 3 | ||||
-rwxr-xr-x | 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 <<EOF; usage: vyatta-qos.pl --list-policy direction @@ -318,7 +324,8 @@ EOF exit 1; } -my (@startList, @updateInterface, @deleteInterface, $updateAction); +my (@startList, @updateInterface, @deleteInterface); +my ($updateAction, $deleteAction); my ($listPolicy, @createPolicy, @applyPolicy, @deletePolicy); GetOptions( @@ -332,7 +339,7 @@ GetOptions( "apply-policy=s" => \@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 ); |