Skip to content

Commit

Permalink
netns: add documentation on how to go back on default netns
Browse files Browse the repository at this point in the history
  • Loading branch information
ffourcot authored and svinota committed Mar 1, 2019
1 parent e7810d9 commit c88a54b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pyroute2/netns/__init__.py
Expand Up @@ -224,6 +224,11 @@ def setns(netns, flags=os.O_CREAT, libc=None):
- O_CREAT -- create netns, if doesn't exist
- O_CREAT | O_EXCL -- create only if doesn't exist
Note that "main" netns as no name. But you can access it with::
setns('foo') # move to netns foo
setns('/proc/1/ns/net') # go back to default netns
Changed in 0.5.1: the routine closes the ns fd if it's
not provided via arguments.
'''
Expand Down

0 comments on commit c88a54b

Please sign in to comment.