aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2023-12-07 22:41:36 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2023-12-07 22:41:36 +0000
commitade05d63b727d5e8d0d833c1d974a9d50d4cb1bb (patch)
tree2469ee64cc20c05cea802d95dcc4046097493a2e
parent9101746a6cce90314ad03c7ff06398a5f68d0cc7 (diff)
downloadsrc-ade05d63b727d5e8d0d833c1d974a9d50d4cb1bb.tar.gz
src-ade05d63b727d5e8d0d833c1d974a9d50d4cb1bb.zip
tcp: stop stack timers in tcp_switch_back_to_default()
This funcion is an alternative code path that detaches an alternative TCP stack, missed in d2ef52ef3dee38cccb7f54d33ecc2a4b944dad9d. Reviewed by: rrs, tuexen Differential Revision: https://reviews.freebsd.org/D42917 Reported-by: syzbot+186130be9f0ca5557d4e@syzkaller.appspotmail.com Fixes: d2ef52ef3dee38cccb7f54d33ecc2a4b944dad9d
-rw-r--r--sys/netinet/tcp_subr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index d951b5df938e..c79cadd04944 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -542,6 +542,9 @@ tcp_switch_back_to_default(struct tcpcb *tp)
KASSERT(tp->t_fb != &tcp_def_funcblk,
("%s: called by the built-in default stack", __func__));
+ if (tp->t_fb->tfb_tcp_timer_stop_all != NULL)
+ tp->t_fb->tfb_tcp_timer_stop_all(tp);
+
/*
* Now, we'll find a new function block to use.
* Start by trying the current user-selected