diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2021-05-21 11:14:49 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2021-05-21 11:14:49 +0200 |
commit | 4adae47c40e2f1bb66e8699747daa2eabee425f7 (patch) | |
tree | 3761d1bb58bfbf94f6c9e8219ebd9aa5bbe567c3 | |
parent | 17337a736ff0e7ebd7d5272eba7466a627795215 (diff) | |
download | passt-4adae47c40e2f1bb66e8699747daa2eabee425f7.tar passt-4adae47c40e2f1bb66e8699747daa2eabee425f7.tar.gz passt-4adae47c40e2f1bb66e8699747daa2eabee425f7.tar.bz2 passt-4adae47c40e2f1bb66e8699747daa2eabee425f7.tar.lz passt-4adae47c40e2f1bb66e8699747daa2eabee425f7.tar.xz passt-4adae47c40e2f1bb66e8699747daa2eabee425f7.tar.zst passt-4adae47c40e2f1bb66e8699747daa2eabee425f7.zip |
passt: Close UNIX domain socket on failure before accepting new connections
The socket isn't necessarily closed, make sure we close it before
getting a new one from accept(), so that we don't mix it up with
protocol sockets numbering.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r-- | passt.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -876,8 +876,10 @@ loop: if (events[i].events & EPOLLRDHUP || events[i].events & EPOLLHUP || events[i].events & EPOLLERR || - tap_handler(&c, &now)) + tap_handler(&c, &now)) { + close(c.fd_unix); goto listen; + } } else { sock_handler(&c, events[i].data.fd, events[i].events, &now); |