summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2016-07-20 09:15:29 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2016-07-20 09:15:29 +0000
commitae03de5b42a499a45ff116b87ba7e8b9e7144bab (patch)
treecfe581f5d9d7031fe283251e62c365faedc58d9b /lib/libc
parent2f109fd72a142902e14827c24ffb16a849b1bc94 (diff)
Make the size for the syn cache hash array tunable. As we are
swapping between two syn caches for random reseeding anyway, this feature can be added easily. When the cache is empty, there is an opportunity to change the hash size. This allows an admin under SYN flood attack to defend his machine. Suggested by claudio@; OK jung@ claudio@ jmc@
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/sysctl.39
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/libc/gen/sysctl.3 b/lib/libc/gen/sysctl.3
index d2e3c98862b..0c6312c52dc 100644
--- a/lib/libc/gen/sysctl.3
+++ b/lib/libc/gen/sysctl.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: sysctl.3,v 1.266 2016/07/14 17:34:06 jmc Exp $
+.\" $OpenBSD: sysctl.3,v 1.267 2016/07/20 09:15:28 bluhm Exp $
.\"
.\" Copyright (c) 1993
.\" The Regents of the University of California. All rights reserved.
@@ -27,7 +27,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd $Mdocdate: July 14 2016 $
+.Dd $Mdocdate: July 20 2016 $
.Dt SYSCTL 3
.Os
.Sh NAME
@@ -1188,6 +1188,7 @@ The currently defined protocols and names are:
.It tcp Ta stats Ta structure Ta no
.It tcp Ta synbucketlimit Ta integer Ta yes
.It tcp Ta syncachelimit Ta integer Ta yes
+.It tcp Ta synhashsize Ta integer Ta yes
.It tcp Ta synuselimit Ta integer Ta yes
.It udp Ta baddynamic Ta array Ta yes
.It udp Ta checksum Ta integer Ta yes
@@ -1617,6 +1618,10 @@ Returns the TCP statistics in a struct tcpstat.
The maximum number of entries allowed per hash bucket in the TCP SYN cache.
.It Li tcp.syncachelimit
The maximum number of entries allowed in the TCP SYN cache.
+.It Li tcp.synhashsize
+The number of buckets in the TCP SYN cache hash array.
+After the value is set, the actual size changes when the alternative
+SYN cache becomes empty and both SYN caches are swapped.
.It Li tcp.synuselimit
The minimum number of times the hash function for the TCP SYN cache is used
before it is reseeded.