summaryrefslogtreecommitdiffstats
path: root/include/net/ip_fib.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2014-09-04 17:21:31 +0200
committerDavid S. Miller <davem@davemloft.net>2014-09-06 02:40:33 +0200
commitd546c621542df9e45eedc91f35356e887ac63b7b (patch)
treebcf28df1dafdf743cdbad9230986a5a413e08a26 /include/net/ip_fib.h
parentnet-timestamp: fix allocation error in test (diff)
downloadlinux-d546c621542df9e45eedc91f35356e887ac63b7b.tar.xz
linux-d546c621542df9e45eedc91f35356e887ac63b7b.zip
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/net/ip_fib.h')
-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 {