Merge pull request #400 from cdburkard/patches/fixEmptyPing

Mininet crashes when running ping between two hosts with no interfaces
This commit is contained in:
lantz
2014-10-13 18:11:19 -07:00
+5 -2
View File
@@ -562,8 +562,11 @@ class Mininet( object ):
opts = ''
if timeout:
opts = '-W %s' % timeout
result = node.cmd( 'ping -c1 %s %s' % (opts, dest.IP()) )
sent, received = self._parsePing( result )
if dest.intfs:
result = node.cmd( 'ping -c1 %s %s' % (opts, dest.IP()) )
sent, received = self._parsePing( result )
else:
sent, received = 0, 0
packets += sent
if received > sent:
error( '*** Error: received too many packets' )