git: 399a5655e6ed - main - tcp: Make TCP PCAP buffer properly configurable.

From: Richard Scheffenegger <rscheff_at_FreeBSD.org>
Date: Tue, 28 Feb 2023 20:16:23 UTC
The branch main has been updated by rscheff:

URL: https://cgit.FreeBSD.org/src/commit/?id=399a5655e6edf69a63f1c37e66fdad19dcfdb5cf

commit 399a5655e6edf69a63f1c37e66fdad19dcfdb5cf
Author:     Richard Scheffenegger <rscheff@FreeBSD.org>
AuthorDate: 2023-02-28 18:57:30 +0000
Commit:     Richard Scheffenegger <rscheff@FreeBSD.org>
CommitDate: 2023-02-28 19:12:11 +0000

    tcp: Make TCP PCAP buffer properly configurable.
    
    Reviewed By:            tuexen, cc, #transport
    MFC after:              3 days
    Sponsored by:           NetApp, Inc.
    Differential Revision:  https://reviews.freebsd.org/D38824
---
 sys/netinet/tcp_usrreq.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index f17285664ce5..d0a929c57c7b 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -2320,7 +2320,8 @@ unlock_and_done:
 
 			INP_WLOCK_RECHECK(inp);
 			if (optval >= 0)
-				tcp_pcap_set_sock_max(TCP_PCAP_OUT ?
+				tcp_pcap_set_sock_max(
+					(sopt->sopt_name == TCP_PCAP_OUT) ?
 					&(tp->t_outpkts) : &(tp->t_inpkts),
 					optval);
 			else
@@ -2561,7 +2562,8 @@ unhold:
 #ifdef TCPPCAP
 		case TCP_PCAP_OUT:
 		case TCP_PCAP_IN:
-			optval = tcp_pcap_get_sock_max(TCP_PCAP_OUT ?
+			optval = tcp_pcap_get_sock_max(
+					(sopt->sopt_name == TCP_PCAP_OUT) ?
 					&(tp->t_outpkts) : &(tp->t_inpkts));
 			INP_WUNLOCK(inp);
 			error = sooptcopyout(sopt, &optval, sizeof optval);