pasta, tcp: Don't set SPLICE_FIN_BOTH state on EPOLLHUP

EPOLLHUP just means we shut down one side of the connection on
*one* socket: remember, we have two sockets here.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
Stefano Brivio 2021-09-16 08:27:06 +02:00
parent e8540b3f26
commit 34dd4b28b0

4
tcp.c
View file

@ -2639,9 +2639,7 @@ void tcp_sock_handler_splice(struct ctx *c, union epoll_ref ref,
} }
} }
if (events & EPOLLHUP) { if (events & EPOLLRDHUP) {
tcp_splice_state(conn, SPLICE_FIN_BOTH);
} else if (events & EPOLLRDHUP) {
if (ref.s == conn->from) { if (ref.s == conn->from) {
if (conn->state == SPLICE_ESTABLISHED) if (conn->state == SPLICE_ESTABLISHED)
tcp_splice_state(conn, SPLICE_FIN_FROM); tcp_splice_state(conn, SPLICE_FIN_FROM);