summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_input.c
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2015-08-27 20:56:16 +0000
committerbluhm <bluhm@openbsd.org>2015-08-27 20:56:16 +0000
commit7a4d62d1113ddce8e026efa98b366130d71b4bee (patch)
tree2f92ba430afd9a111c6cf27a514e89fb97c703d1 /sys/netinet/tcp_input.c
parentIf we take the address of a function pointer, we might get a pointer to (diff)
downloadwireguard-openbsd-7a4d62d1113ddce8e026efa98b366130d71b4bee.tar.xz
wireguard-openbsd-7a4d62d1113ddce8e026efa98b366130d71b4bee.zip
The syn cache is completely implemented in tcp_input.c. So all its
global variables should also live there. OK markus@
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r--sys/netinet/tcp_input.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 0792b547164..e652c97af40 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_input.c,v 1.301 2015/08/24 23:31:35 bluhm Exp $ */
+/* $OpenBSD: tcp_input.c,v 1.302 2015/08/27 20:56:16 bluhm Exp $ */
/* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */
/*
@@ -3276,7 +3276,14 @@ tcp_mss_adv(struct ifnet *ifp, int af)
* state for SYN_RECEIVED.
*/
+/* syn hash parameters */
+#define TCP_SYN_HASH_SIZE 293
+#define TCP_SYN_BUCKET_SIZE 35
+int tcp_syn_cache_size = TCP_SYN_HASH_SIZE;
+int tcp_syn_cache_limit = TCP_SYN_HASH_SIZE*TCP_SYN_BUCKET_SIZE;
+int tcp_syn_bucket_limit = 3*TCP_SYN_BUCKET_SIZE;
int tcp_syn_cache_count;
+struct syn_cache_head tcp_syn_cache[TCP_SYN_HASH_SIZE];
u_int32_t syn_hash1, syn_hash2;
#define SYN_HASH(sa, sp, dp) \