git: 9b3d6127716e - stable/12 - tcp: Make TCP PCAP buffer properly configurable.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 03 Mar 2023 21:29:19 UTC
The branch stable/12 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=9b3d6127716ec0fcc22a5794ffceebdf9220db3e commit 9b3d6127716ec0fcc22a5794ffceebdf9220db3e Author: Richard Scheffenegger <rscheff@FreeBSD.org> AuthorDate: 2023-02-28 18:57:30 +0000 Commit: Richard Scheffenegger <rscheff@FreeBSD.org> CommitDate: 2023-03-02 02:30:07 +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 (cherry picked from commit 399a5655e6edf69a63f1c37e66fdad19dcfdb5cf) --- 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 968b1f4c5e30..33c8ed715581 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -2076,7 +2076,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 @@ -2260,7 +2261,8 @@ unlock_and_done: #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);