git: 528c76492402 - main - tcp: fix compliation when KERN_TLS is not defined

From: Michael Tuexen <tuexen_at_FreeBSD.org>
Date: Wed, 09 Feb 2022 11:19:37 UTC
The branch main has been updated by tuexen:

URL: https://cgit.FreeBSD.org/src/commit/?id=528c76492402d9be8ec83a0a769f0d70e2a32f61

commit 528c76492402d9be8ec83a0a769f0d70e2a32f61
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2022-02-09 11:16:43 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2022-02-09 11:16:43 +0000

    tcp: fix compliation when KERN_TLS is not defined
    
    Reported by:    Gary Jennejohn
    Fixes:          fd7daa727126 - main - tcp: make tcp_ctloutput_set() non-static
    Sponsored by:   Netflix, Inc.
---
 sys/netinet/tcp_usrreq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index 564225f39c88..c88ab5219152 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -2119,13 +2119,13 @@ no_mem_needed:
 int
 tcp_default_ctloutput(struct inpcb *inp, struct sockopt *sopt)
 {
-	struct socket *so = inp->inp_socket;
 	struct tcpcb *tp = intotcpcb(inp);
 	int	error, opt, optval;
 	u_int	ui;
 	struct	tcp_info ti;
 #ifdef KERN_TLS
 	struct tls_enable tls;
+	struct socket *so = inp->inp_socket;
 #endif
 	char	*pbuf, buf[TCP_LOG_ID_LEN];
 #ifdef STATS
@@ -2136,7 +2136,7 @@ tcp_default_ctloutput(struct inpcb *inp, struct sockopt *sopt)
 	INP_WLOCK_ASSERT(inp);
 	KASSERT((inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) == 0,
 	    ("inp_flags == %x", inp->inp_flags));
-	KASSERT(so != NULL, ("inp_socket == NULL"));
+	KASSERT(inp->inp_socket != NULL, ("inp_socket == NULL"));
 
 	switch (sopt->sopt_level) {
 #ifdef INET6