Patchwork [V2,19/23] nl80211: fix nl80211_get_wiphy_index() for P2P Device

login
register
mail settings
Submitter Arend van Spriel
Date May 29, 2013, 9:08 a.m.
Message ID <1369818491-7274-20-git-send-email-arend@broadcom.com>
Download mbox | patch
Permalink /patch/247197/
State Accepted
Headers show

Comments

Arend van Spriel - May 29, 2013, 9:08 a.m.
For P2P Device the netlink message should have wdev identifier
instead of the interface index. This fixes a failure which occurred
executing the P2P_GROUP_ADD command.

Signed-hostap: Arend van Spriel <arend@broadcom.com>
---
 src/drivers/driver_nl80211.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 2a8884f..2fe5c57 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -601,7 +601,8 @@  static int nl80211_get_wiphy_index(struct i802_bss *bss)
 
 	nl80211_cmd(bss->drv, msg, 0, NL80211_CMD_GET_INTERFACE);
 
-	NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, bss->ifindex);
+	if (nl80211_set_iface_id(msg, bss) < 0)
+		goto nla_put_failure;
 
 	if (send_and_recv_msgs(bss->drv, msg, netdev_info_handler, &data) == 0)
 		return data.wiphy_idx;