Skip to content

Commit 9fbf082

Browse files
Leon Romanovskydavem330
authored andcommitted
net/core: Do not clear VF index for node/port GUIDs query
VF numbers were assigned to node_guid and port_guid, but cleared right before such query calls were issued. It caused to return node/port GUIDs of VF index 0 for all VFs. Fixes: 30aad41 ("net/core: Add support for getting VF GUIDs") Reported-by: Adrian Chiris <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 31484d5 commit 9fbf082

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/core/rtnetlink.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,6 +1242,8 @@ static noinline_for_stack int rtnl_fill_vfinfo(struct sk_buff *skb,
12421242
return 0;
12431243

12441244
memset(&vf_vlan_info, 0, sizeof(vf_vlan_info));
1245+
memset(&node_guid, 0, sizeof(node_guid));
1246+
memset(&port_guid, 0, sizeof(port_guid));
12451247

12461248
vf_mac.vf =
12471249
vf_vlan.vf =
@@ -1290,8 +1292,6 @@ static noinline_for_stack int rtnl_fill_vfinfo(struct sk_buff *skb,
12901292
sizeof(vf_trust), &vf_trust))
12911293
goto nla_put_vf_failure;
12921294

1293-
memset(&node_guid, 0, sizeof(node_guid));
1294-
memset(&port_guid, 0, sizeof(port_guid));
12951295
if (dev->netdev_ops->ndo_get_vf_guid &&
12961296
!dev->netdev_ops->ndo_get_vf_guid(dev, vfs_num, &node_guid,
12971297
&port_guid)) {

0 commit comments

Comments
 (0)