diff options
| author | David Gibson <david@gibson.dropbear.id.au> | 2026-05-18 13:22:42 +1000 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2026-05-20 01:22:22 +0200 |
| commit | 5ef0fc44a9a334f6b433a2c795d82b89dd9f1133 (patch) | |
| tree | 235c3d320f865a6d64eb15a3a42ee7b5b25383df | |
| parent | 1d16476b7de00bd5bd77b90955520a79bbec48e6 (diff) | |
| download | passt-5ef0fc44a9a334f6b433a2c795d82b89dd9f1133.tar passt-5ef0fc44a9a334f6b433a2c795d82b89dd9f1133.tar.gz passt-5ef0fc44a9a334f6b433a2c795d82b89dd9f1133.tar.bz2 passt-5ef0fc44a9a334f6b433a2c795d82b89dd9f1133.tar.lz passt-5ef0fc44a9a334f6b433a2c795d82b89dd9f1133.tar.xz passt-5ef0fc44a9a334f6b433a2c795d82b89dd9f1133.tar.zst passt-5ef0fc44a9a334f6b433a2c795d82b89dd9f1133.zip | |
tap: Report accept() errors
Currently, if accept4() fails in tap_listen_handler(), we carry on as if
it succeeded. Something will probably fail shortly down the line, but
that's needlessly confusing. Report an error instead.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
| -rw-r--r-- | tap.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -1493,6 +1493,10 @@ void tap_listen_handler(struct ctx *c, uint32_t events) } c->fd_tap = accept4(c->fd_tap_listen, NULL, NULL, SOCK_CLOEXEC); + if (c->fd_tap < 0) { + warn_perror("Error accepting tap client"); + return; + } if (!getsockopt(c->fd_tap, SOL_SOCKET, SO_PEERCRED, &ucred, &len)) info("accepted connection from PID %i", ucred.pid); |
