configHosts(): don't try to configure nonexistent interfaces.

This commit is contained in:
Bob Lantz
2012-05-23 13:37:02 -07:00
parent 8f310286f8
commit e1ca7196c7
+6 -1
View File
@@ -244,7 +244,12 @@ class Mininet( object ):
"Configure a set of hosts." "Configure a set of hosts."
for host in self.hosts: for host in self.hosts:
info( host.name + ' ' ) info( host.name + ' ' )
host.configDefault( defaultRoute=host.defaultIntf() ) intf = host.defaultIntf()
if intf:
host.configDefault( defaultRoute=intf )
else:
# Don't configure nonexistent intf
host.configDefault( ip=None, mac=None )
# You're low priority, dude! # You're low priority, dude!
# BL: do we want to do this here or not? # BL: do we want to do this here or not?
# May not make sense if we have CPU lmiting... # May not make sense if we have CPU lmiting...