Subject: Re: [PATCH] rtnetlink: Fix message size calculation for link messages

From: Patrick McHardy <[email-masked]>
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 <[email-masked]>
> Cc: Patrick McHardy <[email-masked]>

Looks good to me, thanks Thomas.

Acked-by: Patrick McHardy <[email-masked]>