From 3be131280d0f2c7f834b54cee5346918ab8b2aac Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Thu, 16 Sep 2021 08:19:39 +0200 Subject: pasta, tcp: Set pipe descriptor numbers to -1 after closing ...so that we don't try to close them again, even if harmless. Signed-off-by: Stefano Brivio --- tcp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tcp.c b/tcp.c index cc36ac3..80458e3 100644 --- a/tcp.c +++ b/tcp.c @@ -1583,11 +1583,15 @@ static void tcp_splice_destroy(struct ctx *c, struct tcp_splice_conn *conn) case SPLICE_ESTABLISHED: if (conn->pipe_from_to[0] != -1) { close(conn->pipe_from_to[0]); + conn->pipe_from_to[0] = -1; close(conn->pipe_from_to[1]); + conn->pipe_from_to[1] = -1; } if (conn->pipe_to_from[0] != -1) { close(conn->pipe_to_from[0]); + conn->pipe_to_from[0] = -1; close(conn->pipe_to_from[1]); + conn->pipe_to_from[1] = -1; } /* Falls through */ case SPLICE_CONNECT: -- cgit v1.2.3