summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_usrreq.c
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2004-03-02 12:51:12 +0000
committermarkus <markus@openbsd.org>2004-03-02 12:51:12 +0000
commit38c2c20006722157e77f05d927d6ad2b4172a45d (patch)
treee064ae4c32888079f576442bc0f34eb6f1fbd511 /sys/netinet/tcp_usrreq.c
parentour interface discovery is so quiet now (nonexistant) that we don't need a (diff)
downloadwireguard-openbsd-38c2c20006722157e77f05d927d6ad2b4172a45d.tar.xz
wireguard-openbsd-38c2c20006722157e77f05d927d6ad2b4172a45d.zip
limit total number of queued out-of-order packets to NMBCLUSTERS/2; ok mcbride
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
-rw-r--r--sys/netinet/tcp_usrreq.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index db32c7e2f7c..b66cdbbf59e 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_usrreq.c,v 1.80 2004/02/15 11:16:08 markus Exp $ */
+/* $OpenBSD: tcp_usrreq.c,v 1.81 2004/03/02 12:51:12 markus Exp $ */
/* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */
/*
@@ -878,6 +878,7 @@ tcp_sysctl(name, namelen, oldp, oldlenp, newp, newlen)
void *newp;
size_t newlen;
{
+ int error, nval;
/* All sysctl names at this level are terminal. */
if (namelen != 1)
@@ -903,6 +904,18 @@ tcp_sysctl(name, namelen, oldp, oldlenp, newp, newlen)
return (sysctl_int(oldp, oldlenp, newp, newlen,
&tcp_do_ecn));
#endif
+ case TCPCTL_REASS_LIMIT:
+ nval = tcp_reass_limit;
+ error = sysctl_int(oldp, oldlenp, newp, newlen, &nval);
+ if (error)
+ return (error);
+ if (nval != tcp_reass_limit) {
+ error = pool_sethardlimit(&tcpqe_pool, nval, NULL, 0);
+ if (error)
+ return (error);
+ tcp_reass_limit = nval;
+ }
+ return (0);
default:
if (name[0] < TCPCTL_MAXID)
return (sysctl_int_arr(tcpctl_vars, name, namelen,