summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_subr.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2016-01-27 00:48:05 +0000
committerglebius <glebius@FreeBSD.org>2016-01-27 00:48:05 +0000
commitccaed9e02be515e0496ee4dc90e02aac28c3485a (patch)
tree8522dd948ed8660720e0cc3e190afbaf008d19d2 /sys/netinet/tcp_subr.c
parent9487eaf98f45a433931bad91a3463694f5423688 (diff)
downloadFreeBSD-src-ccaed9e02be515e0496ee4dc90e02aac28c3485a.zip
FreeBSD-src-ccaed9e02be515e0496ee4dc90e02aac28c3485a.tar.gz
Grab a snap amount of TCP connections in syncache from tcpstat.
Diffstat (limited to 'sys/netinet/tcp_subr.c')
-rw-r--r--sys/netinet/tcp_subr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index b16f540..0d16330 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -1590,7 +1590,8 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS)
* resource-intensive to repeat twice on every request.
*/
if (req->oldptr == NULL) {
- n = V_tcbinfo.ipi_count + syncache_pcbcount();
+ n = V_tcbinfo.ipi_count +
+ TCPSTAT_FETCH(tcps_states[TCPS_SYN_RECEIVED]);
n += imax(n / 8, 10);
req->oldidx = 2 * (sizeof xig) + n * sizeof(struct xtcpcb);
return (0);
@@ -1607,7 +1608,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS)
n = V_tcbinfo.ipi_count;
INP_LIST_RUNLOCK(&V_tcbinfo);
- m = syncache_pcbcount();
+ m = TCPSTAT_FETCH(tcps_states[TCPS_SYN_RECEIVED]);
error = sysctl_wire_old_buffer(req, 2 * (sizeof xig)
+ (n + m) * sizeof(struct xtcpcb));
OpenPOWER on IntegriCloud