Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mininet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Olaf Bergmann
mininet
Commits
b3055067
Commit
b3055067
authored
10 years ago
by
Cody Burkard
Browse files
Options
Downloads
Patches
Plain Diff
fixed netParse bug that caused mininet crash when no ip prefix was specified
parent
87b60214
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mininet/util.py
+6
-0
6 additions, 0 deletions
mininet/util.py
with
6 additions
and
0 deletions
mininet/util.py
+
6
−
0
View file @
b3055067
...
@@ -281,6 +281,8 @@ def ipAdd( i, prefixLen=8, ipBaseNum=0x0a000000 ):
...
@@ -281,6 +281,8 @@ def ipAdd( i, prefixLen=8, ipBaseNum=0x0a000000 ):
def
ipParse
(
ip
):
def
ipParse
(
ip
):
"
Parse an IP address and return an unsigned int.
"
"
Parse an IP address and return an unsigned int.
"
args
=
[
int
(
arg
)
for
arg
in
ip
.
split
(
'
.
'
)
]
args
=
[
int
(
arg
)
for
arg
in
ip
.
split
(
'
.
'
)
]
while
(
len
(
args
)
<
4
):
args
.
append
(
0
)
return
ipNum
(
*
args
)
return
ipNum
(
*
args
)
def
netParse
(
ipstr
):
def
netParse
(
ipstr
):
...
@@ -290,6 +292,10 @@ def netParse( ipstr ):
...
@@ -290,6 +292,10 @@ def netParse( ipstr ):
if
'
/
'
in
ipstr
:
if
'
/
'
in
ipstr
:
ip
,
pf
=
ipstr
.
split
(
'
/
'
)
ip
,
pf
=
ipstr
.
split
(
'
/
'
)
prefixLen
=
int
(
pf
)
prefixLen
=
int
(
pf
)
#if no prefix is specified, set the prefix to 24
else
:
ip
=
ipstr
prefixLen
=
24
return
ipParse
(
ip
),
prefixLen
return
ipParse
(
ip
),
prefixLen
def
checkInt
(
s
):
def
checkInt
(
s
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment