aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2025-08-29 22:11:26 +0200
committerStefano Brivio <sbrivio@redhat.com>2025-09-11 17:03:21 +0200
commit2e3d93ba7033754301af0d50cd0bb20a38a005ac (patch)
tree3a6c0058d4a3e475c5cf7a0ae330c78837bf8998
parentd363fb7796db3581161a6cca8dd022d0105052dd (diff)
downloadpasst-2e3d93ba7033754301af0d50cd0bb20a38a005ac.tar
passt-2e3d93ba7033754301af0d50cd0bb20a38a005ac.tar.gz
passt-2e3d93ba7033754301af0d50cd0bb20a38a005ac.tar.bz2
passt-2e3d93ba7033754301af0d50cd0bb20a38a005ac.tar.lz
passt-2e3d93ba7033754301af0d50cd0bb20a38a005ac.tar.xz
passt-2e3d93ba7033754301af0d50cd0bb20a38a005ac.tar.zst
passt-2e3d93ba7033754301af0d50cd0bb20a38a005ac.zip
tcp: FIN flags have to be retransmitted as well
If we're retransmitting any data, and we sent a FIN segment to our peer, regardless of whether it was received, we obviously have to retransmit it as well, given that it can only come with the last data segment, or after it. Unconditionally clear the internal TAP_FIN_SENT flag whenever we re-transmit, so that we know we have to send it again, in case. Reported-by: Paul Holzinger <pholzing@redhat.com> Signed-off-by: Stefano Brivio <sbrivio@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Tested-by: Paul Holzinger <pholzing@redhat.com>
-rw-r--r--tcp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tcp.c b/tcp.c
index a27b069..2dce10d 100644
--- a/tcp.c
+++ b/tcp.c
@@ -1778,6 +1778,7 @@ static int tcp_data_from_tap(const struct ctx *c, struct tcp_tap_conn *conn,
"fast re-transmit, ACK: %u, previous sequence: %u",
max_ack_seq, conn->seq_to_tap);
conn->seq_to_tap = max_ack_seq;
+ conn->events &= ~TAP_FIN_SENT;
if (tcp_set_peek_offset(conn, 0)) {
tcp_rst(c, conn);
return -1;
@@ -2312,6 +2313,7 @@ void tcp_timer_handler(const struct ctx *c, union epoll_ref ref)
flow_dbg(conn, "ACK timeout, retry");
conn->retrans++;
conn->seq_to_tap = conn->seq_ack_from_tap;
+ conn->events &= ~TAP_FIN_SENT;
if (!conn->wnd_from_tap)
conn->wnd_from_tap = 1; /* Zero-window probe */
if (tcp_set_peek_offset(conn, 0)) {