1
0
mirror of https://passt.top/passt synced 2024-07-03 00:12:41 +00:00

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>
This commit is contained in:
Stefano Brivio 2021-05-21 11:14:49 +02:00
parent 17337a736f
commit 4adae47c40

View File

@ -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);