summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2015-08-27 20:56:17 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2015-08-27 20:56:17 +0000
commitcd352b1bdcbf8feba453eb5d5ad539bc8320197a (patch)
treeb2cf4454ddf57d5c990e9383bfc48ad70e1ba3ef /sys/netinet
parentdf3cce3c78e7f44225b652079a70a337dd0df425 (diff)
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')
-rw-r--r--sys/netinet/tcp_input.c9
-rw-r--r--sys/netinet/tcp_subr.c10
-rw-r--r--sys/netinet/tcp_var.h5
3 files changed, 10 insertions, 14 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) \
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 08d23d574fe..4a61fef5fa6 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_subr.c,v 1.145 2015/08/24 15:37:03 bluhm Exp $ */
+/* $OpenBSD: tcp_subr.c,v 1.146 2015/08/27 20:56:16 bluhm Exp $ */
/* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */
/*
@@ -120,14 +120,6 @@ u_int32_t tcp_now = 1;
#define TCB_INITIAL_HASH_SIZE 128
#endif
-/* 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;
-struct syn_cache_head tcp_syn_cache[TCP_SYN_HASH_SIZE];
-
int tcp_reass_limit = NMBCLUSTERS / 2; /* hardlimit for tcpqe_pool */
#ifdef TCP_SACK
int tcp_sackhole_limit = 32*1024; /* hardlimit for sackhl_pool */
diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h
index 746f49eeefa..3a2c66d8652 100644
--- a/sys/netinet/tcp_var.h
+++ b/sys/netinet/tcp_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_var.h,v 1.108 2015/08/24 15:37:03 bluhm Exp $ */
+/* $OpenBSD: tcp_var.h,v 1.109 2015/08/27 20:56:16 bluhm Exp $ */
/* $NetBSD: tcp_var.h,v 1.17 1996/02/13 23:44:24 christos Exp $ */
/*
@@ -558,9 +558,6 @@ extern int tcp_reass_limit; /* max entries for tcp reass queues */
extern int tcp_syn_cache_limit; /* max entries for compressed state engine */
extern int tcp_syn_bucket_limit;/* max entries per hash bucket */
-extern int tcp_syn_cache_size;
-extern struct syn_cache_head tcp_syn_cache[];
-
int tcp_attach(struct socket *);
void tcp_canceltimers(struct tcpcb *);
struct tcpcb *