diff options
| author | David Gibson <david@gibson.dropbear.id.au> | 2026-01-30 15:41:03 +1100 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2026-01-31 03:56:54 +0100 |
| commit | 3581ded2007a1219579fbb1f2cde0b016edd2a96 (patch) | |
| tree | 0eee74633699eafc330ae59fa968277618e85e74 /test | |
| parent | e992b14b405ec4d0f4ea40b447029e23cbc2e30d (diff) | |
| download | passt-3581ded2007a1219579fbb1f2cde0b016edd2a96.tar passt-3581ded2007a1219579fbb1f2cde0b016edd2a96.tar.gz passt-3581ded2007a1219579fbb1f2cde0b016edd2a96.tar.bz2 passt-3581ded2007a1219579fbb1f2cde0b016edd2a96.tar.lz passt-3581ded2007a1219579fbb1f2cde0b016edd2a96.tar.xz passt-3581ded2007a1219579fbb1f2cde0b016edd2a96.tar.zst passt-3581ded2007a1219579fbb1f2cde0b016edd2a96.zip | |
tcp: Eliminate FIN_TIMEOUT
Despite the name and its value of 60s, FIN_TIMEOUT is not related to
the kernel's net.ipv4.tcp_fin_timeout sysctl. Indeed, we can't make
an equivalent to that, since it relies on information that endpoint
kernels have, but we do not.
Neither is it simply the time to wait for an ACK to a FIN. It may
have been intended as that at some point, but the implementation has
not matched that for some time. In any case RFC9293 makes no
distinction between ACKs to FIN segments and ACKs to data segments, so
we now implement handling of ACKs to FINs with the same code path as
ACKs to data segments.
The theory of operation describes FIN_TIMEOUT thus:
- FIN_TIMEOUT: if a FIN segment was acknowledged by tap/guest and a FIN
segment (write shutdown) was sent via socket (events SOCK_FIN_SENT and
TAP_FIN_ACKED), but no socket activity is detected from the socket within
this time, reset the connection
In other words, it's attempting to handle the case that we
shutdown(SHUT_WR) on the socket side (causing the kernel to send a
FIN), but the kernel never responds with an EPOLLHUP event indicating
the peer has acked the FIN.
The description doesn't match what the code does: in tcp_timer_ctl()
we only set FIN_TIMEOUT on our timer when when ACK_FROM_TAP_DUE is
unset, but we only act on the FIN_TIMEOUT if ACK_FROM_TAP_DUE *is*
(also) set.
In fact, there's no need to handle this case. Once we've called
shutdown(SHUT_WR), it's the kernel's responsibility to resend FINs as
needed (and reset the connection if that times out). Therefore,
entirely remove the FIN_TIMEOUT related logic.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'test')
0 files changed, 0 insertions, 0 deletions
