summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-07-27 14:49:09 -0700
committerStephen Hemminger <shemminger@lenny.localdomain>2009-10-01 13:51:21 -0700
commit31678ed9d1021242342576f4b2b21827f077d404 (patch)
treeeeaa14f4ff79df95ea067a39b2786a428f03647b
parent7be3888cba2342a5e7ad2cd774af82558205711e (diff)
downloadvyatta-cfg-qos-31678ed9d1021242342576f4b2b21827f077d404.tar.gz
vyatta-cfg-qos-31678ed9d1021242342576f4b2b21827f077d404.zip
Allow update to interface if not present yet
Solves issues like Bug 4759 where qos-policy is commited to an interface that does not exist in system until later. (cherry picked from commit f94f46058fce5ca110a24ef90935b0f517b16d33)
-rwxr-xr-xscripts/vyatta-qos.pl6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/vyatta-qos.pl b/scripts/vyatta-qos.pl
index eb04ec8..487fdc6 100755
--- a/scripts/vyatta-qos.pl
+++ b/scripts/vyatta-qos.pl
@@ -155,6 +155,12 @@ sub update_interface {
my $shaper = make_policy( $policy, $name, $direction );
exit 1 unless $shaper;
+ if ( ! -d "/sys/class/net/$device" ) {
+ warn "$device not present yet, qos-policy will be applied later\n";
+ return;
+ }
+
+
# Remove old policy
delete_interface( $device, $direction );