Allow changing the transit namespace
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v5 Latest11 patches 1 replyIn review
- v412 patches 3 repliesSuperseded
- v312 patches 0 repliesSuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 | 10 patches | 0 replies | Superseded | |
| v1 | 7 patches | 9 replies | Superseded |
Patches in v5 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/11 | netlink: check for CAP_NET_ADMIN manuallysrc/ | +12 | 0 replies | |
| 2/11 | netlink: allow specifying the device namespacesrc/ src/ | +87 | 0 replies | |
| 3/11 | netlink: restrict access to the UDP socketsrc/ src/ | +25 | 0 replies | |
| 4/11 | device: rename creating_net to transit_netsrc/ src/ src/ +1 more | +18 | 0 replies | |
| 5/11 | device: store a copy of the device netsrc/ src/ | +20 | 0 replies | |
| 6/11 | socket: allow modification of transit_netsrc/ src/ src/ +1 more | +17 | 0 replies | |
| 7/11 | netlink: allow modification of transit netsrc/ src/ | +44 | 1 reply | |
| 8/11 | tools: add framework for shared optionssrc/ src/ src/ +6 more | +72 | 0 replies | |
| 9/11 | tools: allow specifying the device namespacesrc/ src/ src/ +7 more | +155 | 0 replies | |
| 10/11 | tools: allow modification of transit netsrc/ src/ src/ +2 more | +24 | 0 replies | |
| 11/11 | tests: add test for transit-netsrc/ | +40 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.
Cover letter [PATCH v5 00/11] Allow changing the transit namespace
Hi,
This is v5 of this series. This series makes the following changes:
* wg(1) can now access devices in another network namespace. The syntax is
wg --netns <pid|file-path> <subcommand>
For example
wg --netns 5363 show wg0
* wg(1) can now change the network namespace of the UDP socket of a device. The syntax is
wg set <device> transit-netns <pid|file-path>
For example
wg set wg0 transit-netns 5363
* When retrieving or modifying properties of the UDP socket (its incoming port or its network namespace), the netlink code now checks that the calling process has at least one of the following properties:
* The calling process' network namespace is the same as the (new) network namespace of the socket.
* The calling process has the CAP_NET_ADMIN capability in the (new) network namespace of the socket.
These changes allow a user to create a wg device in a user namespace and to set the network namespace of the UDP socket to the init namespace. This allows the user to communicate over a wg device even if the user does not have root in the init namespace.
The code of this version is almost identical to the previous version except that
* the first commit has been dropped and
* the code has been rebased on master.
Julian
Julian Orth (11):
netlink: check for CAP_NET_ADMIN manually
netlink: allow specifying the device namespace
netlink: restrict access to the UDP socket
device: rename creating_net to transit_net
device: store a copy of the device net
socket: allow modification of transit_net
netlink: allow modification of transit net
tools: add framework for shared options
tools: allow specifying the device namespace
tools: allow modification of transit net
tests: add test for transit-net
src/device.c | 35 ++++++---- src/device.h | 6 +- src/netlink.c | 150 ++++++++++++++++++++++++++++++++-------- src/socket.c | 18 ++--- src/socket.h | 6 +- src/tests/netns.sh | 40 +++++++++++ src/tools/config.c | 8 +++ src/tools/containers.h | 22 +++++- src/tools/genkey.c | 3 +- src/tools/ipc.c | 26 +++++-- src/tools/ipc.h | 7 +- src/tools/man/wg.8 | 9 ++- src/tools/netns.c | 62 +++++++++++++++++ src/tools/netns.h | 18 +++++ src/tools/pubkey.c | 3 +- src/tools/set.c | 6 +- src/tools/setconf.c | 4 +- src/tools/show.c | 35 +++++++--- src/tools/showconf.c | 4 +- src/tools/subcommands.h | 14 ++-- src/tools/wg.c | 64 +++++++++++++++-- src/uapi/wireguard.h | 39 ++++++++++- 22 files changed, 477 insertions(+), 102 deletions(-) create mode 100644 src/tools/netns.c create mode 100644 src/tools/netns.h
Signature · 6 lines
2.19.2 _______________________________________________ WireGuard mailing list [email protected] https://lists.zx2c4.com/mailman/listinfo/wireguard