aboutgitcodebugslistschat
path: root/test/lib
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2026-02-04 21:41:37 +1000
committerStefano Brivio <sbrivio@redhat.com>2026-02-25 00:17:45 +0100
commitd2f7c21cfb949f2b1587b9475917efdd6ac549fd (patch)
tree761e4057c6b19b88ba31cca6fb5450040f8f0083 /test/lib
parenta681e44ec60179567fb10f34351d7dfdbd2e7c7e (diff)
downloadpasst-d2f7c21cfb949f2b1587b9475917efdd6ac549fd.tar
passt-d2f7c21cfb949f2b1587b9475917efdd6ac549fd.tar.gz
passt-d2f7c21cfb949f2b1587b9475917efdd6ac549fd.tar.bz2
passt-d2f7c21cfb949f2b1587b9475917efdd6ac549fd.tar.lz
passt-d2f7c21cfb949f2b1587b9475917efdd6ac549fd.tar.xz
passt-d2f7c21cfb949f2b1587b9475917efdd6ac549fd.tar.zst
passt-d2f7c21cfb949f2b1587b9475917efdd6ac549fd.zip
tcp: Send TCP keepalive segments after a period of tap-side inactivityHEADmaster
There are several circumstances in which a live, but idle TCP connection can be forgotten by a guest, with no "on the wire" indication that this has happened. The most obvious is if the guest abruptly reboots. A more subtle case can happen with a half-closed connection, specifically one in FIN_WAIT_2 state on the guest. A connection can, legitimately, remain in this state indefinitely. If however, a socket in this state is closed by userspace, Linux at least will remove the kernel socket after 60s (or as configured in the net.ipv4.tcp_fin_timeout sysctl). Because there's no on the wire indication in these cases, passt will pointlessly retain the connection in its flow table, at least until it is removed by the inactivity timeout after several hours. To avoid keeping connections around for so long in this state, add functionality to periodically send TCP keepalive segments to the guest if we've seen no activity on the tap interface. If the guest is no longer aware of the connection, it should respond with an RST which will let passt remove the stale entry. To do this we use a method similar to the inactivity timeout - a 1-bit page replacement / clock algorithm, but with a shorter interval, and only checking for tap side activity. Currently we use a 300s interval, meaning we'll send a keepalive after 5-10 minutes of (tap side) inactivity. Link: https://bugs.passt.top/show_bug.cgi?id=179 Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'test/lib')
0 files changed, 0 insertions, 0 deletions