Skip to content

Commit

Permalink
netfilter: xt_NFQUEUE: remove modulo operations
Browse files Browse the repository at this point in the history
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
  • Loading branch information
Changli Gao authored and Patrick McHardy committed Nov 12, 2010
1 parent e5fc9e7 commit ca36181
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/netfilter/xt_NFQUEUE.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ca36181

Please sign in to comment.