Date: Wed, 12 Apr 2023 08:56:00 GMT From: Michael Tuexen <tuexen@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 73c48d9d8f89 - main - tcp: fix deregistering stacks when vnets are used Message-ID: <202304120856.33C8u0b9042433@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=73c48d9d8f89f066db5c5eef967a936d6b7f2d1f commit 73c48d9d8f89f066db5c5eef967a936d6b7f2d1f Author: Michael Tuexen <tuexen@FreeBSD.org> AuthorDate: 2023-04-12 08:52:53 +0000 Commit: Michael Tuexen <tuexen@FreeBSD.org> CommitDate: 2023-04-12 08:52:53 +0000 tcp: fix deregistering stacks when vnets are used This fixes a bug where stacks could not be deregistered when end points in the non-default vnet are using it. Reviewed by: glebius, zlei MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D39514 --- sys/netinet/tcp_subr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 36112a101fa8..be78396260c7 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1355,8 +1355,6 @@ deregister_tcp_functions(struct tcp_function_block *blk, bool quiesce, * to the default stack. */ if (force && blk->tfb_refcnt) { - struct inpcb_iterator inpi = INP_ALL_ITERATOR(&V_tcbinfo, - INPLOOKUP_WLOCKPCB); struct inpcb *inp; struct tcpcb *tp; VNET_ITERATOR_DECL(vnet_iter); @@ -1366,6 +1364,9 @@ deregister_tcp_functions(struct tcp_function_block *blk, bool quiesce, VNET_LIST_RLOCK(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); + struct inpcb_iterator inpi = INP_ALL_ITERATOR(&V_tcbinfo, + INPLOOKUP_WLOCKPCB); + while ((inp = inp_next(&inpi)) != NULL) { tp = intotcpcb(inp); if (tp == NULL || tp->t_fb != blk)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202304120856.33C8u0b9042433>