From: Pablo Neira <pablo@eurodev.net>
To: Thomas Graf <tgraf@suug.ch>
Cc: netdev@oss.sgi.com, "David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH 2/4] [NETLINK] introduce netlink_check_skb function
Date: Sat, 12 Feb 2005 22:18:59 +0100 [thread overview]
Message-ID: <420E72C3.1050307@eurodev.net> (raw)
In-Reply-To: <20050211224354.GE31837@postel.suug.ch>
Hi Thomas,
Thomas Graf wrote:
>>They are all the same thing. They all return 16 bytes which is the size
>>of a netlink header. If you and someone else think that those are more
>>readable, I'm ok with it, whatever. I just stole that piece of code as
>>is from current checkings done in xfrm and rtnetlink.
>>
>>
>
>That's absolutely true, my point is that while reading that line
>of code it reads like while the remaining length in the socket buffer
>is still greather or equal than the total message size until the next
>message with a payload of 0, then do something. It looks confusing at
>a first glance because you're not event interested in the payload just
>now. A choice of NLMSG_ALIGN(sizeof(*nlh)) or NLMSG_LENGTH(0) clearly
>points out that you're just checking for enough room regarding the
>netlink header in order to access it safely and do the real sanity
>check against the complete message length. Engross that thought a bit
>further, NLMSG_SPACE could change at some point assuming that it is
>only used in contexts where the total message size is in question.
>
>If you think that's too much of nitpicking, then forget about it. It's
>technicaly absolutely correct at the moment.
>
>
Looks fine you convince me. If this is finally pushed forward, let's
replace that line. Thanks.
--
Pablo
prev parent reply other threads:[~2005-02-12 21:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-11 0:14 [PATCH 2/4] [NETLINK] introduce netlink_check_skb function Pablo Neira
2005-02-11 3:24 ` Thomas Graf
2005-02-11 21:31 ` Pablo Neira
2005-02-11 22:43 ` Thomas Graf
2005-02-12 21:18 ` Pablo Neira [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=420E72C3.1050307@eurodev.net \
--to=pablo@eurodev.net \
--cc=davem@davemloft.net \
--cc=netdev@oss.sgi.com \
--cc=tgraf@suug.ch \
/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).