diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-03-14 06:03:17 +0000 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-03-15 12:38:40 +0100 |
commit | 1cdb09056b27b2a06b06dc7187d2c33d57082d20 (patch) | |
tree | 3f35fb8ebbafd2936be7b323b43982363af8ac8f | |
parent | fa900b9cf5a574cc66cc9b50749999d8b6de6ed8 (diff) | |
download | op-kernel-dev-1cdb09056b27b2a06b06dc7187d2c33d57082d20.zip op-kernel-dev-1cdb09056b27b2a06b06dc7187d2c33d57082d20.tar.gz |
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 <pablo@netfilter.org>
-rw-r--r-- | net/netfilter/nfnetlink_queue_core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/nfnetlink_queue_core.c b/net/netfilter/nfnetlink_queue_core.c index 858fd52..350c50f 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 * |