]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Fix nl80211_get_wiphy_index() for P2P Device
authorArend van Spriel <arend@broadcom.com>
Sun, 30 Jun 2013 07:29:00 +0000 (10:29 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 30 Jun 2013 07:50:13 +0000 (10:50 +0300)
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

index cde90f0e9559d30e7aaf11cad4140a4ead4fda45..ed5d6f406645f25350bff54896a6f69a94fed5cc 100644 (file)
@@ -712,7 +712,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;