[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.1101271918250.13796@pc-004.diku.dk>
Date: Thu, 27 Jan 2011 19:18:35 +0100 (CET)
From: Julia Lawall <julia@...u.dk>
To: Ben Pfaff <blp@...stanford.edu>
Cc: hadi@...erus.ca, netdev@...r.kernel.org
Subject: Re: question about nla_nest_cancel
On Thu, 27 Jan 2011, Ben Pfaff wrote:
> Julia Lawall <julia@...u.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.
Indeed. Thank you for the explanation.
julia
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists