mirror of
https://passt.top/passt
synced 2025-06-01 13:55:38 +02:00
tcp: Unconditionally move to CLOSED state on tcp_rst()
tcp_rst() attempts to send an RST packet to the guest, and if that succeeds moves the flow to CLOSED state. However, even if the tcp_send_flag() fails the flow is still dead: we've usually closed the socket already, and something has already gone irretrievably wrong. So we should still mark the flow as CLOSED. That will cause it to be cleaned up, meaning any future packets from the guest for it won't match a flow, so should generate new RSTs (they don't at the moment, but that's a separate bug). Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
4b8660b3d5
commit
44eed5c950
1 changed files with 2 additions and 2 deletions
4
tcp.c
4
tcp.c
|
@ -1216,8 +1216,8 @@ void tcp_rst_do(const struct ctx *c, struct tcp_tap_conn *conn)
|
|||
if (conn->events == CLOSED)
|
||||
return;
|
||||
|
||||
if (!tcp_send_flag(c, conn, RST))
|
||||
conn_event(c, conn, CLOSED);
|
||||
tcp_send_flag(c, conn, RST);
|
||||
conn_event(c, conn, CLOSED);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue