From: David Miller <davem@davemloft.net>
To: kaber@trash.net
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] rtnetlink: Fix message size calculation for link messages
Date: Fri, 12 Nov 2010 10:53:18 -0800 (PST) [thread overview]
Message-ID: <20101112.105318.226783106.davem@davemloft.net> (raw)
In-Reply-To: <4CDCF032.7040802@trash.net>
From: Patrick McHardy <kaber@trash.net>
Date: Fri, 12 Nov 2010 08:43:46 +0100
> On 12.11.2010 02:47, Thomas Graf wrote:
>> nlmsg_total_size() calculates the length of a netlink message
>> including header and alignment. nla_total_size() calculates the
>> space an individual attribute consumes which was meant to be used
>> in this context.
>>
>> Also, ensure to account for the attribute header for the
>> IFLA_INFO_XSTATS attribute as implementations of get_xstats_size()
>> seem to assume that we do so.
>>
>> The addition of two message headers minus the missing attribute
>> header resulted in a calculated message size that was larger than
>> required. Therefore we never risked running out of skb tailroom.
>>
>> Signed-off-by: Thomas Graf <tgraf@infradead.org>
>> Cc: Patrick McHardy <kaber@trash.net>
>
> Looks good to me, thanks Thomas.
>
> Acked-by: Patrick McHardy <kaber@trash.net>
Applied, thanks.
prev parent reply other threads:[~2010-11-12 18:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-12 1:47 [PATCH] rtnetlink: Fix message size calculation for link messages Thomas Graf
2010-11-12 7:43 ` Patrick McHardy
2010-11-12 18:53 ` David Miller [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=20101112.105318.226783106.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=kaber@trash.net \
--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;
as well as URLs for NNTP newsgroup(s).