]> git.itanic.dy.fi Git - linux-stable/commit
rtnetlink: fix rtnl_vfinfo_size
authorSabrina Dubroca <sd@queasysnail.net>
Tue, 15 Nov 2016 09:39:03 +0000 (10:39 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 23 Feb 2017 03:54:34 +0000 (03:54 +0000)
commit6a9c63564c4f3ce1a01b72b5e2316208c01c48c4
tree62d62c9a17a9baaa3bd2474402919751f583f21e
parent79f45203f41517c71772c002daa53ac3f52c5f7d
rtnetlink: fix rtnl_vfinfo_size

commit 7e75f74a171a8146cc3ee92d5562878b40c25fb5 upstream.

The size reported by rtnl_vfinfo_size doesn't match the space used by
rtnl_fill_vfinfo.

rtnl_vfinfo_size currently doesn't account for the nest attributes
used by statistics (added in commit 3b766cd83232), nor for struct
ifla_vf_tx_rate (since commit ed616689a3d9, which added ifla_vf_rate
to the dump without removing ifla_vf_tx_rate, but replaced
ifla_vf_tx_rate with ifla_vf_rate in the size computation).

Fixes: 3b766cd83232 ("net/core: Add reading VF statistics through the PF netdevice")
Fixes: ed616689a3d9 ("net-next:v4: Add support to configure SR-IOV VF minimum and maximum Tx rate through ip tool")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to 3.16: only need to add space for IFLA_VF_TX_RATE]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/core/rtnetlink.c