From: Ken-ichirou MATSUZAWA <chamaken@gmail.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: The netfilter developer mailinglist <netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH libmnl] nlmsg: introduce mnl_nlmsg_batch_rest to get the rest length
Date: Thu, 20 Apr 2017 12:32:55 +0900 [thread overview]
Message-ID: <20170420033255.GA28407@gmail.com> (raw)
In-Reply-To: <20170413222700.GA5024@salvia>
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,
prev parent reply other threads:[~2017-04-20 3:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-03 6:11 [PATCH libmnl] nlmsg: introduce mnl_nlmsg_batch_rest to get the rest length Ken-ichirou MATSUZAWA
2017-04-13 22:27 ` Pablo Neira Ayuso
2017-04-20 3:32 ` Ken-ichirou MATSUZAWA [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170420033255.GA28407@gmail.com \
--to=chamaken@gmail.com \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).