diff options
author | Jiri Benc <jbenc@redhat.com> | 2014-08-08 10:44:32 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-08-08 13:28:09 -0400 |
commit | 945a36761fd7877660f630bbdeb4ff9ff80d1935 (patch) | |
tree | d65de4ab6ce3c4bb6c84adc9069cbef1f0175bbb /net/core | |
parent | f8e8be1c1ee67801d26f0d1e9548b59cbf607bf1 (diff) |
rtnetlink: fix VF info size
Commit 1d8faf48c74b8 ("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: 1d8faf48c74b8 ("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>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/rtnetlink.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 8d39071f32d7..f0493e3b7471 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -804,7 +804,8 @@ static inline int rtnl_vfinfo_size(const struct net_device *dev, | |||
804 | (nla_total_size(sizeof(struct ifla_vf_mac)) + | 804 | (nla_total_size(sizeof(struct ifla_vf_mac)) + |
805 | nla_total_size(sizeof(struct ifla_vf_vlan)) + | 805 | nla_total_size(sizeof(struct ifla_vf_vlan)) + |
806 | nla_total_size(sizeof(struct ifla_vf_spoofchk)) + | 806 | nla_total_size(sizeof(struct ifla_vf_spoofchk)) + |
807 | nla_total_size(sizeof(struct ifla_vf_rate))); | 807 | nla_total_size(sizeof(struct ifla_vf_rate)) + |
808 | nla_total_size(sizeof(struct ifla_vf_link_state))); | ||
808 | return size; | 809 | return size; |
809 | } else | 810 | } else |
810 | return 0; | 811 | return 0; |