diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2022-02-18 16:12:11 +0100 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2022-02-21 13:41:13 +0100 |
commit | 745a9ba4284cbe055aac3fadb57efe531c4e3a96 (patch) | |
tree | 6283140095f6652d119fbf619890269b3d1d869d /passt.h | |
parent | 6c931118643c8fa35935ddbd920cb669dec10021 (diff) | |
download | passt-745a9ba4284cbe055aac3fadb57efe531c4e3a96.tar passt-745a9ba4284cbe055aac3fadb57efe531c4e3a96.tar.gz passt-745a9ba4284cbe055aac3fadb57efe531c4e3a96.tar.bz2 passt-745a9ba4284cbe055aac3fadb57efe531c4e3a96.tar.lz passt-745a9ba4284cbe055aac3fadb57efe531c4e3a96.tar.xz passt-745a9ba4284cbe055aac3fadb57efe531c4e3a96.tar.zst passt-745a9ba4284cbe055aac3fadb57efe531c4e3a96.zip |
pasta: By default, quit if filesystem-bound net namespace goes away
This should be convenient for users managing filesystem-bound network
namespaces: monitor the base directory of the namespace and exit if
the namespace given as PATH or NAME target is deleted. We can't add
an inotify watch directly on the namespace directory, that won't work
with nsfs.
Add an option to disable this behaviour, --no-netns-quit.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'passt.h')
-rw-r--r-- | passt.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -101,6 +101,9 @@ enum passt_modes { * @pasta_netns_fd: File descriptor for network namespace in pasta mode * @pasta_userns_fd: Descriptor for user namespace to join, -1 once joined * @netns_only: In pasta mode, don't join or create a user namespace + * @no_netns_quit: In pasta mode, don't exit if fs-bound namespace is gone + * @netns_base: Base name for fs-bound namespace, if any, in pasta mode + * @netns_dir: Directory of fs-bound namespace, if any, in pasta mode * @proc_net_tcp: Stored handles for /proc/net/tcp{,6} in init and ns * @proc_net_udp: Stored handles for /proc/net/udp{,6} in init and ns * @epollfd: File descriptor for epoll instance @@ -161,6 +164,10 @@ struct ctx { int pasta_userns_fd; int netns_only; + int no_netns_quit; + char netns_base[PATH_MAX]; + char netns_dir[PATH_MAX]; + int proc_net_tcp[IP_VERSIONS][2]; int proc_net_udp[IP_VERSIONS][2]; |