if there are no interfaces to ping, there are no packets sent

This commit is contained in:
cody burkard
2014-10-01 23:05:34 -07:00
parent ded25a9ef8
commit 778267aa75
+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' )