summaryrefslogtreecommitdiffstats
path: root/samples
diff options
context:
space:
mode:
authorThomas Graf <tgraf@infradead.org>2010-11-11 16:47:59 +0100
committerDavid S. Miller <davem@davemloft.net>2010-11-12 19:53:09 +0100
commit369cf77a6a3e41b1110506ddf43d45804103bfde (patch)
tree6bd88b669c8c68ac4d9008e00566ca15e43a6ff4 /samples
parentMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linvil... (diff)
downloadlinux-369cf77a6a3e41b1110506ddf43d45804103bfde.tar.xz
linux-369cf77a6a3e41b1110506ddf43d45804103bfde.zip
rtnetlink: Fix message size calculation for link messages
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> Acked-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'samples')
0 files changed, 0 insertions, 0 deletions