Commit 2cda2882 authored by Rusty Russell's avatar Rusty Russell Committed by David S. Miller

[NETFILTER]: Don't try to do any random dropping since we now use jenkins hash

Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 59f9f96e
...@@ -571,7 +571,6 @@ init_conntrack(const struct ip_conntrack_tuple *tuple, ...@@ -571,7 +571,6 @@ init_conntrack(const struct ip_conntrack_tuple *tuple,
size_t hash; size_t hash;
struct ip_conntrack_expect *expected; struct ip_conntrack_expect *expected;
int i; int i;
static unsigned int drop_next;
if (!ip_conntrack_hash_rnd_initted) { if (!ip_conntrack_hash_rnd_initted) {
get_random_bytes(&ip_conntrack_hash_rnd, 4); get_random_bytes(&ip_conntrack_hash_rnd, 4);
...@@ -580,15 +579,10 @@ init_conntrack(const struct ip_conntrack_tuple *tuple, ...@@ -580,15 +579,10 @@ init_conntrack(const struct ip_conntrack_tuple *tuple,
hash = hash_conntrack(tuple); hash = hash_conntrack(tuple);
if (ip_conntrack_max && if (ip_conntrack_max
atomic_read(&ip_conntrack_count) >= ip_conntrack_max) { && atomic_read(&ip_conntrack_count) >= ip_conntrack_max) {
/* Try dropping from random chain, or else from the /* Try dropping from this hash chain. */
chain about to put into (in case they're trying to if (!early_drop(&ip_conntrack_hash[hash])) {
bomb one hash chain). */
unsigned int next = (drop_next++)%ip_conntrack_htable_size;
if (!early_drop(&ip_conntrack_hash[next])
&& !early_drop(&ip_conntrack_hash[hash])) {
if (net_ratelimit()) if (net_ratelimit())
printk(KERN_WARNING printk(KERN_WARNING
"ip_conntrack: table full, dropping" "ip_conntrack: table full, dropping"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment