mirror of
https://passt.top/passt
synced 2024-12-22 13:45:32 +00:00
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 <sbrivio@redhat.com>
This commit is contained in:
parent
d481578882
commit
3be131280d
4
tcp.c
4
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:
|
||||
|
Loading…
Reference in New Issue
Block a user