git: 775da7f8a924 - main - tcp: Remove a redundant net_epoch entry in tcp6_connect()

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Mon, 13 Feb 2023 21:35:53 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=775da7f8a9248d148ffd50635cf043c015146225

commit 775da7f8a9248d148ffd50635cf043c015146225
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2023-02-13 21:21:10 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2023-02-13 21:35:47 +0000

    tcp: Remove a redundant net_epoch entry in tcp6_connect()
    
    tcp6_connect() is always called in a net_epoch read section.
    
    Fixes:          3d76be28ec60 ("netinet6: require network epoch for in6_pcbconnect()")
    Reviewed by:    tuexen, glebius
    Sponsored by:   Klara, Inc.
    Differential Revision:  https://reviews.freebsd.org/D38506
---
 sys/netinet/tcp_usrreq.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index c204fc356ed7..43f2fcfb097a 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -1433,16 +1433,14 @@ static int
 tcp6_connect(struct tcpcb *tp, struct sockaddr_in6 *sin6, struct thread *td)
 {
 	struct inpcb *inp = tptoinpcb(tp);
-	struct epoch_tracker et;
 	int error;
 
+	NET_EPOCH_ASSERT();
 	INP_WLOCK_ASSERT(inp);
 
-	NET_EPOCH_ENTER(et);
 	INP_HASH_WLOCK(&V_tcbinfo);
 	error = in6_pcbconnect(inp, sin6, td->td_ucred, true);
 	INP_HASH_WUNLOCK(&V_tcbinfo);
-	NET_EPOCH_EXIT(et);
 	if (error != 0)
 		return (error);