Re: [PATCHv2] netfilter: nft: add queue module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Eric,

On Wed, Dec 04, 2013 at 01:47:43PM +0100, Eric Leblond wrote:
[...]
> > > +static u32
> > > +nfqueue_hash(const struct nft_pktinfo *pkt, const struct nft_queue *priv)
> > > +{
> > > +	u32 queue = priv->queuenum;
> > > +
> > > +	if (priv->family == AF_INET)
> > > +		queue += ((u64) hash_v4(pkt->skb) * priv->queues_total) >> 32;
> > > +#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
> > > +	else if (priv->family == AF_INET6)
> > > +		queue += ((u64) hash_v6(pkt->skb) * priv->queues_total) >> 32;
> > > +#endif
> > > +
> > > +	return queue;
> > > +}
> > 
> > to there, it looks very similar to NFQUEUE. You can move these
> > functions to net/netfilter/nf_queue.h. You'll have to inline them and
> > add the jhash_initval parameter. You'll need an initial patch to
> > prepare this change and adapt xt_NFQUEUE.c
> 
> I'm ok with the two hash functions but the nfqueue_hash the second
> argument is different. Do you want me to introduce a new common
> structure for xt_NFQUEUE and nft_queue ?

My suggestion is to add something like:

static inline u32 nfqueue_hash(const struct sk_buff *skb, u16 queuenum,
                               u16 queues_total, u8 family)

that can be used by both, it will also be defined in
net/netfilter/nf_queue.h
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux