Re: [PATCH libnetfilter_queue v2 1/1] src: Add nfq_nlmsg_put2() - user specifies header flags

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

 



On Wed, Nov 15, 2023 at 11:25:27AM +0100, Pablo Neira Ayuso wrote:
> On Wed, Nov 15, 2023 at 09:09:50PM +1100, Duncan Roe wrote:
> > +EXPORT_SYMBOL
> > +struct nlmsghdr *nfq_nlmsg_put2(char *buf, int type, uint32_t queue_num,
> > +				uint16_t flags)
> >  {
> >  	struct nlmsghdr *nlh = mnl_nlmsg_put_header(buf);
> >  	nlh->nlmsg_type = (NFNL_SUBSYS_QUEUE << 8) | type;
> > -	nlh->nlmsg_flags = NLM_F_REQUEST
> > +	nlh->nlmsg_flags = flags;
>
> Leave this as is.
>
> NLM_F_REQUEST means this message goes to the kernel, this flag is a
> must have.

How about

	nlh->nlmsg_flags = NLM_F_REQUEST | flags;

Or, you could apply v1.
I couldn't see a use case for other flags (NLM_F_DUMP and so on) otherwise I
would have made flags an arg in v1.

On Tue, Nov 14, 2023 at 04:26:26PM +0100, Pablo Neira Ayuso wrote:
[...]
> I like this, but I'd suggest instead:
>
>   struct nlmsghdr *nfq_nlmsg_put2(char *buf, int type, uint32_t queue_num, uint16_flags);
>
> I should have expose those netlink flags in first place.
>
> There are more useful netlink flags, so just expose them all.
>
LMK,

Cheers ... Duncan.



[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux