diff options
author | 2004-03-02 12:51:12 +0000 | |
---|---|---|
committer | 2004-03-02 12:51:12 +0000 | |
commit | 38c2c20006722157e77f05d927d6ad2b4172a45d (patch) | |
tree | e064ae4c32888079f576442bc0f34eb6f1fbd511 /sys/netinet/tcp_subr.c | |
parent | our interface discovery is so quiet now (nonexistant) that we don't need a (diff) | |
download | wireguard-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_subr.c')
-rw-r--r-- | sys/netinet/tcp_subr.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index b920816bad5..27e9bd25203 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_subr.c,v 1.76 2004/02/27 16:44:45 markus Exp $ */ +/* $OpenBSD: tcp_subr.c,v 1.77 2004/03/02 12:51:12 markus Exp $ */ /* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */ /* @@ -148,17 +148,18 @@ 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 INET6 extern int ip6_defhlim; #endif /* INET6 */ struct pool tcpcb_pool; +struct pool tcpqe_pool; #ifdef TCP_SACK struct pool sackhl_pool; #endif -int tcp_freeq(struct tcpcb *); - struct tcpstat tcpstat; /* tcp statistics */ tcp_seq tcp_iss; @@ -173,6 +174,9 @@ tcp_init() #endif /* TCP_COMPAT_42 */ pool_init(&tcpcb_pool, sizeof(struct tcpcb), 0, 0, 0, "tcpcbpl", NULL); + pool_init(&tcpqe_pool, sizeof(struct ipqent), 0, 0, 0, "tcpqepl", + NULL); + pool_sethardlimit(&tcpqe_pool, tcp_reass_limit, NULL, 0); #ifdef TCP_SACK pool_init(&sackhl_pool, sizeof(struct sackhole), 0, 0, 0, "sackhlpl", NULL); @@ -717,7 +721,7 @@ tcp_freeq(struct tcpcb *tp) while ((qe = LIST_FIRST(&tp->segq)) != NULL) { LIST_REMOVE(qe, ipqe_q); m_freem(qe->ipqe_m); - pool_put(&ipqent_pool, qe); + pool_put(&tcpqe_pool, qe); rv = 1; } return (rv); |