Netdev List
 help / color / mirror / Atom feed
From: Kurt Van Dijck <kurt.van.dijck@eia.be>
To: Julia Lawall <julia@diku.dk>
Cc: hadi@cyberus.ca, netdev@vger.kernel.org
Subject: Re: question about nla_nest_cancel
Date: Thu, 27 Jan 2011 18:21:18 +0100	[thread overview]
Message-ID: <20110127172118.GA331@e-circ.dyndns.org> (raw)
In-Reply-To: <Pine.LNX.4.64.1101271804530.13796@pc-004.diku.dk>

On Thu, Jan 27, 2011 at 06:08:34PM +0100, Julia Lawall wrote:
> 
> I find numerous occurrences of code like the following, in which nest ends 
> up with the value NULL and then nla_nest_cancel is called with nest as the 
> second argument.  But nla_nest_cancel just calls nlmsg_trim with the same 
> second argument, and nlmsg_trim does nothing if its second argument is 
> NULL.  Is there any reason to keep these calls?
I just learned this:
nla_nest_start() adds data to the skb.
nla_nest_end() 'commits' the proper length.
nla_nest_cancel() reverts skb to the state before nla_nest_start(),
as if nothing happened.

Kurt

  reply	other threads:[~2011-01-27 17:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-27 17:08 question about nla_nest_cancel Julia Lawall
2011-01-27 17:21 ` Kurt Van Dijck [this message]
2011-01-27 17:25   ` Julia Lawall
2011-01-27 17:52 ` Ben Pfaff
2011-01-27 18:18   ` Julia Lawall

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=20110127172118.GA331@e-circ.dyndns.org \
    --to=kurt.van.dijck@eia.be \
    --cc=hadi@cyberus.ca \
    --cc=julia@diku.dk \
    --cc=netdev@vger.kernel.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