Merge pull request #704 from mininet/devel/ipBase
Updating Mininet to start with host IP request in ipBase
This commit is contained in:
+2
-1
@@ -144,7 +144,8 @@ class Mininet( object ):
|
||||
self.intf = intf
|
||||
self.ipBase = ipBase
|
||||
self.ipBaseNum, self.prefixLen = netParse( self.ipBase )
|
||||
self.nextIP = 1 # start for address allocation
|
||||
hostIP = ( 0xffffffff >> self.prefixLen ) & self.ipBaseNum
|
||||
self.nextIP = hostIP if hostIP > 0 else 1 # start for address allocation
|
||||
self.inNamespace = inNamespace
|
||||
self.xterms = xterms
|
||||
self.cleanup = cleanup
|
||||
|
||||
+1
-1
@@ -321,7 +321,7 @@ def ipParse( ip ):
|
||||
"Parse an IP address and return an unsigned int."
|
||||
args = [ int( arg ) for arg in ip.split( '.' ) ]
|
||||
while len(args) < 4:
|
||||
args.append( 0 )
|
||||
args.insert( len(args) - 1, 0 )
|
||||
return ipNum( *args )
|
||||
|
||||
def netParse( ipstr ):
|
||||
|
||||
Reference in New Issue
Block a user