mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
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
This commit is contained in:
parent
9f83fca886
commit
399a5655e6
|
@ -2320,7 +2320,8 @@ tcp_default_ctloutput(struct inpcb *inp, struct sockopt *sopt)
|
|||
|
||||
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 @@ tcp_default_ctloutput(struct inpcb *inp, struct sockopt *sopt)
|
|||
#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);
|
||||
|
|
Loading…
Reference in a new issue