From patchwork Wed May 29 09:08:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arend van Spriel X-Patchwork-Id: 247197 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 771EB2C0209 for ; Wed, 29 May 2013 19:12:32 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 4AE3B9C11C; Wed, 29 May 2013 05:11:31 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LJ63x9ub9Fee; Wed, 29 May 2013 05:11:31 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 6FE779C174; Wed, 29 May 2013 05:09:00 -0400 (EDT) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 01E429C174 for ; Wed, 29 May 2013 05:08:59 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NInK00vixShJ for ; Wed, 29 May 2013 05:08:53 -0400 (EDT) Received: from mms2.broadcom.com (mms2.broadcom.com [216.31.210.18]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id A02909C11C for ; Wed, 29 May 2013 05:08:26 -0400 (EDT) Received: from [10.9.208.57] by mms2.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.5)); Wed, 29 May 2013 02:02:44 -0700 X-Server-Uuid: 4500596E-606A-40F9-852D-14843D8201B2 Received: from IRVEXCHSMTP1.corp.ad.broadcom.com (10.9.207.51) by IRVEXCHCAS08.corp.ad.broadcom.com (10.9.208.57) with Microsoft SMTP Server (TLS) id 14.1.438.0; Wed, 29 May 2013 02:08:19 -0700 Received: from mail-sj1-12.sj.broadcom.com (10.10.10.20) by IRVEXCHSMTP1.corp.ad.broadcom.com (10.9.207.51) with Microsoft SMTP Server id 14.1.438.0; Wed, 29 May 2013 02:08:19 -0700 Received: from arend-ubuntu-1 (unknown [10.176.68.31]) by mail-sj1-12.sj.broadcom.com (Postfix) with ESMTP id 7AAC9207E4; Wed, 29 May 2013 02:08:16 -0700 (PDT) Received: from arend by arend-ubuntu-1 with local (Exim 4.80) ( envelope-from ) id 1UhcMh-0001vo-GR; Wed, 29 May 2013 11:08:15 +0200 From: "Arend van Spriel" To: "Jouni Malinen" Subject: [PATCH V2 19/23] nl80211: fix nl80211_get_wiphy_index() for P2P Device Date: Wed, 29 May 2013 11:08:06 +0200 Message-ID: <1369818491-7274-20-git-send-email-arend@broadcom.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1369818491-7274-1-git-send-email-arend@broadcom.com> References: <1369818491-7274-1-git-send-email-arend@broadcom.com> MIME-Version: 1.0 X-WSS-ID: 7DBB1BBE1R022865366-01-01 Cc: hostap@lists.shmoo.com X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.11 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com 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 --- src/drivers/driver_nl80211.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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;