mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-19 00:04:18 +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 <shaw.leon@gmail.com>
Link: https://patch.msgid.link/20250219125039.18024-13-shaw.leon@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
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
|