From 5c9c8bfff71ed51ab26eab7f3def145a59dca07b Mon Sep 17 00:00:00 2001 From: ahrenholz Date: Tue, 28 Oct 2014 17:24:31 +0000 Subject: [PATCH] set IP addresses on TAP devices used with EMANE 0.9.2 (fixes bug #268) (Boeing r1892) --- daemon/core/emane/nodes.py | 1 + daemon/core/netns/vif.py | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/daemon/core/emane/nodes.py b/daemon/core/emane/nodes.py index bb5fac8d..65526063 100644 --- a/daemon/core/emane/nodes.py +++ b/daemon/core/emane/nodes.py @@ -212,6 +212,7 @@ class EmaneNode(EmaneNet): for netif in self.netifs(): if do_netns and "virtual" in netif.transport_type.lower(): netif.install() + netif.setaddrs() # if we are listening for EMANE events, don't generate them if self.session.emane.doeventmonitor(): netif.poshook = None diff --git a/daemon/core/netns/vif.py b/daemon/core/netns/vif.py index 87e6a4da..32b40647 100644 --- a/daemon/core/netns/vif.py +++ b/daemon/core/netns/vif.py @@ -1,6 +1,6 @@ # # CORE -# Copyright (c)2011-2012 the Boeing Company. +# Copyright (c)2011-2014 the Boeing Company. # See the LICENSE file included in this distribution. # # authors: Tom Goff @@ -111,10 +111,14 @@ class TunTap(PyCoreNetIf): return self.node.cmd([IP_BIN, "link", "set", self.localname, "name", self.name]) + self.node.cmd([IP_BIN, "link", "set", self.name, "up"]) + + def setaddrs(self): + ''' Set interface addresses based on self.addrlist. + ''' for addr in self.addrlist: self.node.cmd([IP_BIN, "addr", "add", str(addr), "dev", self.name]) - self.node.cmd([IP_BIN, "link", "set", self.name, "up"]) class GreTap(PyCoreNetIf): ''' GRE TAP device for tunneling between emulation servers.