Re: [PATCH nf-next] netfilter: nf_tables: export set count and backend name to userspace

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

 



Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> wrote:
> > +/* no error checking: non-essential debug info */
> > +static void nf_tables_fill_set_info(struct sk_buff *skb,
> > +				    const struct nft_set *set)
> > +{
> > +	unsigned int nelems = atomic_read(&set->nelems);
> > +	const char *str = kasprintf(GFP_ATOMIC, "%ps", set->ops);
> > +
> > +	nla_put_be32(skb, NFTA_SET_NELEMS, htonl(nelems));
> > +
> > +	if (str)
> > +		nla_put_string(skb, NFTA_SET_OPSNAME, str);
> > +
> > +	kfree(str);
> 
> Can you think of a case where this cannot fit in the skbuff either in
> netlink dump or event path? I would check for errors here.

I'll change it, no problem.

> If you like my syntax proposal in userspace:
> 
>         size 128        # count 56
> 
> maybe rename _NELEMS to _COUNT.
> 
> As for NFTA_SET_OPSNAME, I suggest NFTA_SET_TYPE.

OK.




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

  Powered by Linux