diff --git a/mininet/net.py b/mininet/net.py index fd0719b1ce6bd0cb416fac42229c92a824590f2c..cd9b9885262480132502f7b130987c881e1a43ae 100755 --- a/mininet/net.py +++ b/mininet/net.py @@ -562,8 +562,11 @@ def ping( self, hosts=None, timeout=None ): 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' )