From 9802686b3277322a7d10bf8ae6bebe08ddd25a4d Mon Sep 17 00:00:00 2001 From: Bob Lantz Date: Wed, 18 Aug 2010 10:04:42 -0700 Subject: [PATCH] Switches use high default intf; disable slicing for user switch. ;-( This should fix --switch user --innamespace. --- mininet/node.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mininet/node.py b/mininet/node.py index 748cde0..e41d83f 100644 --- a/mininet/node.py +++ b/mininet/node.py @@ -441,6 +441,14 @@ class Switch( Node ): if self.listenPort: self.opts += ' --listen=ptcp:%i ' % self.listenPort + def defaultIntf( self ): + "Return interface for HIGHEST port" + ports = self.intfs.keys() + if ports: + intf = self.intfs[ max( ports ) ] + print "RETURNING", intf + return intf + def sendCmd( self, *cmd, **kwargs ): """Send command to Node. cmd: string""" @@ -481,7 +489,7 @@ class UserSwitch( Switch ): if self.inNamespace: intfs = intfs[ :-1 ] self.cmd( 'ofdatapath -i ' + ','.join( intfs ) + - ' punix:/tmp/' + self.name + mac_str + + ' punix:/tmp/' + self.name + mac_str + ' --no-slicing ' + ' 1> ' + ofdlog + ' 2> ' + ofdlog + ' &' ) self.cmd( 'ofprotocol unix:/tmp/' + self.name + ' tcp:%s:%d' % ( controller.IP(), controller.port ) +