Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Dec 2021 05:10:07 GMT
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 12ae3476f35c - main - tcp_drain(): initialize the inpcb iterator when curvnet is set
Message-ID:  <202112030510.1B35A7Fq099607@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by glebius:

URL: https://cgit.FreeBSD.org/src/commit/?id=12ae3476f35c1f7c0e8cb55444728ed04c7130f9

commit 12ae3476f35c1f7c0e8cb55444728ed04c7130f9
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2021-12-03 05:08:30 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2021-12-03 05:08:30 +0000

    tcp_drain(): initialize the inpcb iterator when curvnet is set
    
    Reported by:    cy
    Pointy hat to:  glebius
    Fixes:          de2d47842e88
---
 sys/netinet/tcp_subr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 5b5df6821e6a..86417aad5836 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -2613,8 +2613,6 @@ tcp_close(struct tcpcb *tp)
 void
 tcp_drain(void)
 {
-	struct inpcb_iterator inpi = INP_ALL_ITERATOR(&V_tcbinfo,
-	    INPLOOKUP_WLOCKPCB);
 	VNET_ITERATOR_DECL(vnet_iter);
 
 	if (!do_tcpdrain)
@@ -2623,6 +2621,8 @@ tcp_drain(void)
 	VNET_LIST_RLOCK_NOSLEEP();
 	VNET_FOREACH(vnet_iter) {
 		CURVNET_SET(vnet_iter);
+		struct inpcb_iterator inpi = INP_ALL_ITERATOR(&V_tcbinfo,
+		    INPLOOKUP_WLOCKPCB);
 		struct inpcb *inpb;
 		struct tcpcb *tcpb;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202112030510.1B35A7Fq099607>