diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -2320,7 +2320,8 @@ 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 @@ #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);