Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
re6stnet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
re6stnet
Commits
d288e269
Commit
d288e269
authored
Jul 07, 2022
by
zhifan huang
Committed by
Xiaowu Zhang
Aug 29, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
doc: add comment for iface name patch in fixnemu
parent
f9b112a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
demo/fixnemu.py
demo/fixnemu.py
+4
-1
No files found.
demo/fixnemu.py
View file @
d288e269
...
@@ -75,7 +75,10 @@ get_addr_data.func_code = _get_addr_data.func_code
...
@@ -75,7 +75,10 @@ get_addr_data.func_code = _get_addr_data.func_code
@staticmethod
@staticmethod
def _gen_if_name():
def _gen_if_name():
n = Interface._gen_next_id()
n = Interface._gen_next_id()
# Max 15 chars
# The maximum size of the interface name is 15(char [IFNAMSIZ(16)])
# len(NETNSbr-) = 8, So we need to limit the part "%.4x%.3x" % (os.getpid(), n)
# to size 7. That means PID < 0xffff, n < 0xfff
# PID often exceeds 0xffff, so use mod 0xffff to limit it length.
return "NETNSif-%.4x%.3x" % (os.getpid() % 0xffff, n)
return "NETNSif-%.4x%.3x" % (os.getpid() % 0xffff, n)
Interface._gen_if_name = _gen_if_name
Interface._gen_if_name = _gen_if_name
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment