ipv4: harden fnhe_hashfun()
authorEric Dumazet <edumazet@google.com>
Thu, 4 Sep 2014 15:21:31 +0000 (08:21 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 6 Sep 2014 00:40:33 +0000 (17:40 -0700)
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>
include/net/ip_fib.h
net/ipv4/route.c

index f30fd55..dc9d2a2 100644 (file)
@@ -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 {
Simple merge