From 284547080c457acc4d6005be2a889bfff5aab725 Mon Sep 17 00:00:00 2001 From: Andrew Ferguson Date: Mon, 20 Jan 2014 17:45:30 -0500 Subject: [PATCH] don't crash when link is TCLink but without options caused by optimized return in link.py#275 in TCIntf.config() --- mininet/node.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mininet/node.py b/mininet/node.py index 64f143a..b249cd9 100644 --- a/mininet/node.py +++ b/mininet/node.py @@ -847,10 +847,13 @@ class UserSwitch( Switch ): minspeed = ifspeed * 0.001 res = intf.config( **intf.params ) - parent = res['parent'] + + if res is None: # link may not have TC parameters + return # Re-add qdisc, root, and default classes user switch created, but # with new parent, as setup by Mininet's TCIntf + parent = res['parent'] intf.tc( "%s qdisc add dev %s " + parent + " handle 1: htb default 0xfffe" ) intf.tc( "%s class add dev %s classid 1:0xffff parent 1: htb rate "