From f1123e71ae44474b66521a261483218ede80a042 Mon Sep 17 00:00:00 2001
From: cody burkard <cody@onlab.us>
Date: Thu, 2 Oct 2014 09:19:07 -0700
Subject: [PATCH] update interface IP address with pexec so that backgrounded
 process output from the cli cannot interfere

---
 mininet/link.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mininet/link.py b/mininet/link.py
index efb802e9..df22ea36 100644
--- a/mininet/link.py
+++ b/mininet/link.py
@@ -86,7 +86,9 @@ def setMAC( self, macstr ):
 
     def updateIP( self ):
         "Return updated IP address based on ifconfig"
-        ifconfig = self.ifconfig()
+        # use pexec instead of node.cmd so that we dont read
+        # backgrounded output from the cli.
+        ifconfig, _err, _exitCode = self.node.pexec( 'ifconfig %s' % self.name )
         ips = self._ipMatchRegex.findall( ifconfig )
         self.ip = ips[ 0 ] if ips else None
         return self.ip
-- 
GitLab