From: Changli Gao <xiaosuo@gmail.com>
Date: Fri, 12 Nov 2010 16:34:17 +0000 (+0100)
Subject: netfilter: xt_NFQUEUE: remove modulo operations
X-Git-Tag: MMI-PSA29.97-13-9~20520^2~510^2~40
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ca36181050a523f6c0af3ef7cb509bbbc4ede276;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git

netfilter: xt_NFQUEUE: remove modulo operations

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
---

diff --git a/net/netfilter/xt_NFQUEUE.c b/net/netfilter/xt_NFQUEUE.c
index 039cce1bde3d..39627706aac6 100644
--- a/net/netfilter/xt_NFQUEUE.c
+++ b/net/netfilter/xt_NFQUEUE.c
@@ -72,10 +72,12 @@ nfqueue_tg_v1(struct sk_buff *skb, const struct xt_action_param *par)
 
 	if (info->queues_total > 1) {
 		if (par->family == NFPROTO_IPV4)
-			queue = hash_v4(skb) % info->queues_total + queue;
+			queue = (((u64) hash_v4(skb) * info->queues_total) >>
+				 32) + queue;
 #if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE)
 		else if (par->family == NFPROTO_IPV6)
-			queue = hash_v6(skb) % info->queues_total + queue;
+			queue = (((u64) hash_v6(skb) * info->queues_total) >>
+				 32) + queue;
 #endif
 	}
 	return NF_QUEUE_NR(queue);