aboutgitcodebugslistschat
path: root/test/nstool.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2023-05-14 13:49:43 +0200
committerStefano Brivio <sbrivio@redhat.com>2023-05-23 16:13:28 +0200
commit2fe0461856347d404acb60e3343e6e15459cb5e1 (patch)
tree7f2b0e33a756bbe89938ae84f044dd201298f0a5 /test/nstool.c
parentf099afb1f2f0a15eb0209a9893a5a23455939e71 (diff)
downloadpasst-2fe0461856347d404acb60e3343e6e15459cb5e1.tar
passt-2fe0461856347d404acb60e3343e6e15459cb5e1.tar.gz
passt-2fe0461856347d404acb60e3343e6e15459cb5e1.tar.bz2
passt-2fe0461856347d404acb60e3343e6e15459cb5e1.tar.lz
passt-2fe0461856347d404acb60e3343e6e15459cb5e1.tar.xz
passt-2fe0461856347d404acb60e3343e6e15459cb5e1.tar.zst
passt-2fe0461856347d404acb60e3343e6e15459cb5e1.zip
netlink: Add functionality to copy routes from outer namespace
Instead of just fetching the default gateway and configuring a single equivalent route in the target namespace, on 'pasta --config-net', it might be desirable in some cases to copy the whole set of routes corresponding to a given output interface. For instance, in: https://github.com/containers/podman/issues/18539 IPv4 Default Route Does Not Propagate to Pasta Containers on Hetzner VPSes configuring the default gateway won't work without a gateway-less route (specifying the output interface only), because the default gateway is, somewhat dubiously, not on the same subnet as the container. This is a similar case to the one covered by commit 7656a6f88882 ("conf: Adjust netmask on mismatch between IPv4 address/netmask and gateway"), and I'm not exactly proud of that workaround. We also have: https://bugs.passt.top/show_bug.cgi?id=49 pasta does not work with tap-style interface for which, eventually, we should be able to configure a gateway-less route in the target namespace. Introduce different operation modes for nl_route(), including a new NL_DUP one, not exposed yet, which simply parrots back to the kernel the route dump for a given interface from the outer namespace, fixing up flags and interface indices on the way, and requesting to add the same routes in the target namespace, on the interface we manage. For n routes we want to duplicate, send n identical netlink requests including the full dump: routes might depend on each other and the kernel processes RTM_NEWROUTE messages sequentially, not atomically, and repeating the full dump naturally resolves dependencies without the need to actually calculate them. I'm not kidding, it actually works pretty well. Link: https://github.com/containers/podman/issues/18539 Link: https://bugs.passt.top/show_bug.cgi?id=49 Signed-off-by: Stefano Brivio <sbrivio@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'test/nstool.c')
0 files changed, 0 insertions, 0 deletions