]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
tcp: clear all TCP timers in tcp_timer_stop() when in callout
authorGleb Smirnoff <glebius@FreeBSD.org>
Mon, 18 Mar 2024 20:57:00 +0000 (13:57 -0700)
committerGleb Smirnoff <glebius@FreeBSD.org>
Mon, 18 Mar 2024 20:57:00 +0000 (13:57 -0700)
commite34ea0196f4497d3f3939025aff3a89ee77b652e
tree40506b603ee44c3e28ef652a508c91bf30621c18
parent576fbcbf2dc08f6a4a9f373a916cec2af246f93b
tcp: clear all TCP timers in tcp_timer_stop() when in callout

When a TCP callout decides to disable self, e.g. tcp_timer_2msl() calling
tcp_close(), we must also clear all other possible timers.  Otherwise,
upon return, the callout would be scheduled again in tcp_timer_enter().

Revert 57e27ff07aff, which was a temporary partial revert of otherwise
correct 62d47d73b7eb, that exposed the problem being fixed now.  Add an
extra assertion in tcp_timer_enter() to check we aren't arming callout for
a closed connection.

Reviewed by: rscheff
sys/netinet/tcp_subr.c
sys/netinet/tcp_timer.c