rtnetlink: fix VF info size
Commit1d8faf48c7
("net/core: Add VF link state control") added new attribute to IFLA_VF_INFO group in rtnl_fill_ifinfo but did not adjust size of the allocated memory in if_nlmsg_size/rtnl_vfinfo_size. As the result, we may trigger warnings in rtnl_getlink and similar functions when many VF links are enabled, as the information does not fit into the allocated skb. Fixes:1d8faf48c7
("net/core: Add VF link state control") Reported-by: Yulong Pei <ypei@redhat.com> Signed-off-by: Jiri Benc <jbenc@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
f8e8be1c1e
commit
945a36761f
1 changed files with 2 additions and 1 deletions
|
@ -804,7 +804,8 @@ static inline int rtnl_vfinfo_size(const struct net_device *dev,
|
|||
(nla_total_size(sizeof(struct ifla_vf_mac)) +
|
||||
nla_total_size(sizeof(struct ifla_vf_vlan)) +
|
||||
nla_total_size(sizeof(struct ifla_vf_spoofchk)) +
|
||||
nla_total_size(sizeof(struct ifla_vf_rate)));
|
||||
nla_total_size(sizeof(struct ifla_vf_rate)) +
|
||||
nla_total_size(sizeof(struct ifla_vf_link_state)));
|
||||
return size;
|
||||
} else
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue