mirror of
https://github.com/torvalds/linux.git
synced 2026-11-20 21:12:43 +00:00
Change netns of current thread and switch back on context exit.
For example:
with NetNSEnter("ns1"):
ip("link add dummy0 type dummy")
The command be executed in netns "ns1".
Signed-off-by: Xiao Liang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
10 lines
285 B
Python
10 lines
285 B
Python
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
from .consts import KSRC
|
|
from .ksft import *
|
|
from .netns import NetNS, NetNSEnter
|
|
from .nsim import *
|
|
from .utils import *
|
|
from .ynl import NlError, YnlFamily, EthtoolFamily, NetdevFamily, RtnlFamily, RtnlAddrFamily
|
|
from .ynl import NetshaperFamily
|