summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2014-09-04 08:21:31 -0700
committerDavid S. Miller <davem@davemloft.net>2014-09-05 17:40:33 -0700
commitd546c621542df9e45eedc91f35356e887ac63b7b (patch)
treebcf28df1dafdf743cdbad9230986a5a413e08a26 /include
parent18a47e6d8af01db1b691802a6bb8eae73d83ad9e (diff)
ipv4: harden fnhe_hashfun()
Lets make this hash function a bit secure, as ICMP attacks are still in the wild. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/ip_fib.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index f30fd554127e..dc9d2a27c315 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -65,7 +65,8 @@ struct fnhe_hash_bucket {
struct fib_nh_exception __rcu *chain;
};
-#define FNHE_HASH_SIZE 2048
+#define FNHE_HASH_SHIFT 11
+#define FNHE_HASH_SIZE (1 << FNHE_HASH_SHIFT)
#define FNHE_RECLAIM_DEPTH 5
struct fib_nh {