diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2022-10-07 04:01:56 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2022-10-15 02:10:36 +0200 |
commit | a62ed181db9ba7d85d057365d5331dd35026247f (patch) | |
tree | 960239e3c58df5d81b7f95f8489fbe0829380007 /tap.c | |
parent | 9de65dd3f43a0ee976cc01250641834d99bbfa74 (diff) | |
download | passt-a62ed181db9ba7d85d057365d5331dd35026247f.tar passt-a62ed181db9ba7d85d057365d5331dd35026247f.tar.gz passt-a62ed181db9ba7d85d057365d5331dd35026247f.tar.bz2 passt-a62ed181db9ba7d85d057365d5331dd35026247f.tar.lz passt-a62ed181db9ba7d85d057365d5331dd35026247f.tar.xz passt-a62ed181db9ba7d85d057365d5331dd35026247f.tar.zst passt-a62ed181db9ba7d85d057365d5331dd35026247f.zip |
conf, tap: Add option to quit once the client closes the connection
This is practical to avoid explicit lifecycle management in users,
e.g. libvirtd, and is trivial to implement.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'tap.c')
-rw-r--r-- | tap.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -1011,5 +1011,10 @@ void tap_handler(struct ctx *c, int fd, uint32_t events, return; reinit: + if (c->one_off) { + info("Client closed connection, exiting"); + exit(EXIT_SUCCESS); + } + tap_sock_init(c); } |