Re: [PATCH libmnl] nlmsg: introduce mnl_nlmsg_batch_rest to get the rest length

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

 



On Fri, Apr 14, 2017 at 12:27:00AM +0200, Pablo Neira Ayuso wrote:
> On Mon, Apr 03, 2017 at 03:11:27PM +0900, Ken-ichirou MATSUZAWA wrote:
> > enables to help to wrap these. As of this C library, we can use
> > this like below without double sized buffer.
> > 
> >     char buf[MNL_SOCKET_BUFFER_SIZE];
> > 
> >     b = mnl_nlmsg_batch_start(buf, sizeof(buf));
> >     nlbuf = mnl_nlmsg_batch_current(b);
> >     rest = mnl_nlmsg_batch_rest(b);
> >     if (rest < NLMSG_HDRLEN)
> >             return false;
> 
> Only for this usecase above?

So far, yes. Is it worthless to apply?

> >     nlh = mnl_nlmsg_put_header(nlbuf);
> 
> Probably we need mnl_nlmsg_put_header_check()?

And I guess mnl_nlmsg_put_extra_header_check will also be needed.
I am going to resend if you intend to apply those.

Thanks,
--
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