netfilter: remove modulo operations
Subsystems (2)
PATCH RESEND 1/1 netfilter: remove modulo operations
Signed-off-by Changli Gao <[email protected]>
Acked-by Eric Dumazet <[email protected]>
--- net/netfilter/xt_NFQUEUE.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
net/netfilter/xt_NFQUEUE.c +4 -2
@@ -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);
Patrick McHardy
AppliedAm 12.11.2010 16:59, schrieb Changli Gao:
Quoted 2 lines
Signed-off-by Changli Gao <[email protected]>Acked-by Eric Dumazet <[email protected]>
Applied, thanks.