Fix OVS legacy switch.
This commit is contained in:
+3
-2
@@ -662,7 +662,7 @@ class Switch( Node ):
|
|||||||
"Derive dpid from switch name, s1 -> 1"
|
"Derive dpid from switch name, s1 -> 1"
|
||||||
dpid = int( re.findall( '\d+', self.name )[ 0 ] )
|
dpid = int( re.findall( '\d+', self.name )[ 0 ] )
|
||||||
dpid = hex( dpid )[ 2: ]
|
dpid = hex( dpid )[ 2: ]
|
||||||
dpid = '0' * ( 12 - len( dpid ) ) + dpid
|
dpid = '0' * ( 16 - len( dpid ) ) + dpid
|
||||||
return dpid
|
return dpid
|
||||||
|
|
||||||
def defaultIntf( self ):
|
def defaultIntf( self ):
|
||||||
@@ -749,7 +749,7 @@ class OVSLegacyKernelSwitch( Switch ):
|
|||||||
dp: netlink id (0, 1, 2, ...)
|
dp: netlink id (0, 1, 2, ...)
|
||||||
defaultMAC: default MAC as unsigned int; random value if None"""
|
defaultMAC: default MAC as unsigned int; random value if None"""
|
||||||
Switch.__init__( self, name, **kwargs )
|
Switch.__init__( self, name, **kwargs )
|
||||||
self.dp = 'dp%i' % dp
|
self.dp = self.name
|
||||||
self.intf = self.dp
|
self.intf = self.dp
|
||||||
if self.inNamespace:
|
if self.inNamespace:
|
||||||
error( "OVSKernelSwitch currently only works"
|
error( "OVSKernelSwitch currently only works"
|
||||||
@@ -763,6 +763,7 @@ class OVSLegacyKernelSwitch( Switch ):
|
|||||||
moduleName='Open vSwitch (openvswitch.org)')
|
moduleName='Open vSwitch (openvswitch.org)')
|
||||||
moduleDeps( subtract=OF_KMOD, add=OVS_KMOD )
|
moduleDeps( subtract=OF_KMOD, add=OVS_KMOD )
|
||||||
|
|
||||||
|
|
||||||
def start( self, controllers ):
|
def start( self, controllers ):
|
||||||
"Start up kernel datapath."
|
"Start up kernel datapath."
|
||||||
ofplog = '/tmp/' + self.name + '-ofp.log'
|
ofplog = '/tmp/' + self.name + '-ofp.log'
|
||||||
|
|||||||
Reference in New Issue
Block a user