summaryrefslogtreecommitdiff
path: root/sys/kern/kern_sysctl.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-09-20 22:53:14 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-09-20 22:53:14 +0000
commitc922f1a659a0bb42a2e826c000568c540770e4af (patch)
treea4e78fa7dccb50511704fecbc4877af2064ffbcd /sys/kern/kern_sysctl.c
parent33a9681c867009363487e3d4d4201e9d7c4d25fb (diff)
`solve' the syn bomb problem as well as currently known; add sysctl's for
SOMAXCONN (kern.somaxconn), SOMINCONN (kern.sominconn), and TCPTV_KEEP_INIT (net.inet.tcp.keepinittime). when this is not enough (ie. overfull), start doing tail drop, but slightly prefer the same port.
Diffstat (limited to 'sys/kern/kern_sysctl.c')
-rw-r--r--sys/kern/kern_sysctl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index ce090a7baf3..c3c20b170dd 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sysctl.c,v 1.11 1996/08/08 06:36:45 tholo Exp $ */
+/* $OpenBSD: kern_sysctl.c,v 1.12 1996/09/20 22:53:09 deraadt Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
@@ -204,6 +204,7 @@ kern_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
{
int error, level, inthostid;
extern char ostype[], osrelease[], osversion[], version[];
+ extern int somaxconn, sominconn;
/* all sysctl names at this level are terminal */
if (namelen != 1 && !(name[0] == KERN_PROC || name[0] == KERN_PROF))
@@ -289,6 +290,10 @@ kern_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
return (sysctl_rdint(oldp, oldlenp, newp, RAW_PART));
case KERN_NTPTIME:
return (sysctl_ntptime(oldp, oldlenp));
+ case KERN_SOMAXCONN:
+ return (sysctl_int(oldp, oldlenp, newp, newlen, &somaxconn));
+ case KERN_SOMINCONN:
+ return (sysctl_int(oldp, oldlenp, newp, newlen, &sominconn));
default:
return (EOPNOTSUPP);
}