From 4a59bd28bf2d7c901505be21db4bc12415f0711d Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 15 Apr 2010 16:05:38 -0700 Subject: Fix modification of input-policy If policy changes, then the whole ingress qdisc needs to be reloaded. --- interface-templates/input-policy/node.def | 3 +-- scripts/vyatta-qos.pl | 7 ++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/interface-templates/input-policy/node.def b/interface-templates/input-policy/node.def index 094375e..4f25d62 100644 --- a/interface-templates/input-policy/node.def +++ b/interface-templates/input-policy/node.def @@ -1,3 +1,2 @@ help: Set incoming packet policy -update: /opt/vyatta/sbin/vyatta-qos.pl --update-ingress $IFNAME -delete: sudo tc qdisc del dev $IFNAME ingress 2>/dev/null +end: /opt/vyatta/sbin/vyatta-qos.pl --update-ingress $IFNAME diff --git a/scripts/vyatta-qos.pl b/scripts/vyatta-qos.pl index b6c2f92..0fd003f 100755 --- a/scripts/vyatta-qos.pl +++ b/scripts/vyatta-qos.pl @@ -254,11 +254,12 @@ sub update_ingress { die "$device not present\n" unless (-d "/sys/class/net/$device"); - my $ingress = ingress_policy( $device ); - return unless $ingress; - # Drop existing ingress and recreate system("sudo tc qdisc del dev $device ingress 2>/dev/null"); + + my $ingress = ingress_policy( $device ); + return unless $ingress; + system("sudo tc qdisc add dev $device ingress") == 0 or die "Can not set ingress qdisc"; -- cgit v1.2.3