Skip to content

Commit

Permalink
Fix "failed to open netns" error in RISCV64.
Browse files Browse the repository at this point in the history
The method bellow can be used to verify the modification in riscv64.
1. Create a test.py file with the following content.
from pyroute2 import IPDB, NetNS
with IPDB(NetNS("test")) as ipdb_ns:
    print(ipdb_ns)
2. Run the following command to see if there exists any error.
ip netns add test
python3 test.py

Signed-off-by: zhouliang-eswin <[email protected]>
  • Loading branch information
zhouliang-eswin committed Sep 5, 2023
1 parent 32f5fa0 commit f0df9a4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pyroute2/netns/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
'ppc6': {'64bit': 350},
's390': {'64bit': 339},
'loongarch64': {'64bit': 268},
'risc': {'64bit': 268},
}
__NR_setns = __NR.get(config.machine[:4], {}).get(config.arch, 308)

Expand Down

0 comments on commit f0df9a4

Please sign in to comment.