Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 199212
b: refs/heads/master
c: 045de01
h: refs/heads/master
v: v3
  • Loading branch information
Scott Feldman authored and David S. Miller committed May 28, 2010
1 parent 08e1003 commit c8aacc0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8ca9418350eccd5dd2659931807c1901224dd638
refs/heads/master: 045de01a174d9f0734f657eb4b3313d89b4fd5ad
11 changes: 6 additions & 5 deletions trunk/net/core/rtnetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,11 +650,12 @@ static inline int rtnl_vfinfo_size(const struct net_device *dev)
if (dev->dev.parent && dev_is_pci(dev->dev.parent)) {

int num_vfs = dev_num_vf(dev->dev.parent);
size_t size = nlmsg_total_size(sizeof(struct nlattr));
size += nlmsg_total_size(num_vfs * sizeof(struct nlattr));
size += num_vfs * (sizeof(struct ifla_vf_mac) +
sizeof(struct ifla_vf_vlan) +
sizeof(struct ifla_vf_tx_rate));
size_t size = nla_total_size(sizeof(struct nlattr));
size += nla_total_size(num_vfs * sizeof(struct nlattr));
size += num_vfs *
(nla_total_size(sizeof(struct ifla_vf_mac)) +
nla_total_size(sizeof(struct ifla_vf_vlan)) +
nla_total_size(sizeof(struct ifla_vf_tx_rate)));
return size;
} else
return 0;
Expand Down

0 comments on commit c8aacc0

Please sign in to comment.