From: Pablo Neira Ayuso Date: Thu, 14 Mar 2013 06:03:17 +0000 (+0000) Subject: netfilter: nfnetlink_queue: use xor hash function to distribute instances X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1cdb09056b27b2a06b06dc7187d2c33d57082d20;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git netfilter: nfnetlink_queue: use xor hash function to distribute instances Thanks to Eric Dumazet for suggesting this during the NFWS. Signed-off-by: Pablo Neira Ayuso --- diff --git a/net/netfilter/nfnetlink_queue_core.c b/net/netfilter/nfnetlink_queue_core.c index 858fd52c1040..350c50fbfd4d 100644 --- a/net/netfilter/nfnetlink_queue_core.c +++ b/net/netfilter/nfnetlink_queue_core.c @@ -73,7 +73,7 @@ static struct hlist_head instance_table[INSTANCE_BUCKETS] __read_mostly; static inline u_int8_t instance_hashfn(u_int16_t queue_num) { - return ((queue_num >> 8) | queue_num) % INSTANCE_BUCKETS; + return ((queue_num >> 8) ^ queue_num) % INSTANCE_BUCKETS; } static struct nfqnl_instance *