Netdev List
 help / color / mirror / Atom feed
From: Ben Pfaff <blp@cs.stanford.edu>
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 09:52:53 -0800	[thread overview]
Message-ID: <87pqrikzd6.fsf@benpfaff.org> (raw)
In-Reply-To: <Pine.LNX.4.64.1101271804530.13796@pc-004.diku.dk> (Julia Lawall's message of "Thu, 27 Jan 2011 18:08:34 +0100 (CET)")

Julia Lawall <julia@diku.dk> writes:

> 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 think that you are missing that NLA_PUT() contains an internal
"goto nla_put_failure;".  If that branch is taken, then
nla_nest_cancel() trims off the nested attribute.  So just
removing the call to nla_nest_cancel() would change behavior in
that case.
-- 
Ben Pfaff 
http://benpfaff.org

  parent reply	other threads:[~2011-01-27 18:12 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
2011-01-27 17:25   ` Julia Lawall
2011-01-27 17:52 ` Ben Pfaff [this message]
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=87pqrikzd6.fsf@benpfaff.org \
    --to=blp@cs.stanford.edu \
    --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