summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_subr.c
diff options
context:
space:
mode:
authortruckman <truckman@FreeBSD.org>2002-07-28 19:59:31 +0000
committertruckman <truckman@FreeBSD.org>2002-07-28 19:59:31 +0000
commitb1555a27432152cc7817d0c592bbcebf95fdfd19 (patch)
tree6dda6f0898c9f15fca929e63e72b3882862e67e1 /sys/netinet/tcp_subr.c
parent5bd1876975f34760da2eea4bfce9c738127d36ca (diff)
downloadFreeBSD-src-b1555a27432152cc7817d0c592bbcebf95fdfd19.zip
FreeBSD-src-b1555a27432152cc7817d0c592bbcebf95fdfd19.tar.gz
Wire the sysctl output buffer before grabbing any locks to prevent
SYSCTL_OUT() from blocking while locks are held. This should only be done when it would be inconvenient to make a temporary copy of the data and defer calling SYSCTL_OUT() until after the locks are released.
Diffstat (limited to 'sys/netinet/tcp_subr.c')
-rw-r--r--sys/netinet/tcp_subr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index c2799d5..0c4b385 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -841,6 +841,9 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS)
INP_INFO_RUNLOCK(&tcbinfo);
splx(s);
+ sysctl_wire_old_buffer(req, 2 * (sizeof xig)
+ + n * sizeof(struct xtcpcb));
+
xig.xig_len = sizeof xig;
xig.xig_count = n;
xig.xig_gen = gencnt;
OpenPOWER on IntegriCloud