From patchwork Wed Apr 3 15:17:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Otcheretianski, Andrei" X-Patchwork-Id: 1075785 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NfNGRlJL"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44Z3cm1cfYz9sSS for ; Wed, 3 Apr 2019 22:24:08 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yMoPa14aHN24m8rZfCGTcb/qU0aljVaz8W9+jpZDOkM=; b=NfNGRlJLXkdSM/ bmACYmME/zDCXiOSKXAwLuUKYbbuTjiWgDk65iOZWFYhzWNGgEvZ1GO/fBQCjkH5xhT9CHGwg+jNB IKqrlYmP1lOzIR6VYoNAmseQaDKJYd1GPAwJzAidNoRrIHCN9jQ8gybs3+YaI+tae5nRnAkh6owxV jvlQF4S1jVnDpfPOD++yieJALMRjCmvqBXe0tpsZ3qsDRtbCWDGEe6ClOAjtejsbAEcj2MM5Tw5BW ELaisQH9eL3yhYAfEhRjvkiDy2VSgD5aykIf0JHFydYSkQN1bpZxfLrEewZvHc2Nk5UvOCJXnWpsR IJh63xGTacqV4vpBAiCQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBdzx-00050i-CT; Wed, 03 Apr 2019 11:24:05 +0000 Received: from mga14.intel.com ([192.55.52.115]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBdzq-0004wA-KF for hostap@lists.infradead.org; Wed, 03 Apr 2019 11:23:59 +0000 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Apr 2019 04:23:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,304,1549958400"; d="scan'208";a="128260502" Received: from andrei-xps-12-9q33.jer.intel.com ([10.12.190.129]) by orsmga007.jf.intel.com with ESMTP; 03 Apr 2019 04:23:57 -0700 From: Andrei Otcheretianski To: hostap@lists.infradead.org Subject: [PATCH] nl80211: Handle NL80211_CMD_PROBE_CLIENT response Date: Wed, 3 Apr 2019 18:17:12 +0300 Message-Id: <20190403151719.12165-2-andrei.otcheretianski@intel.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190403151719.12165-1-andrei.otcheretianski@intel.com> References: <20190403151719.12165-1-andrei.otcheretianski@intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190403_042358_668246_D528E895 X-CRM114-Status: GOOD ( 12.97 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [192.55.52.115 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 2.4 DATE_IN_FUTURE_03_06 Date: is 3 to 6 hours after Received: date X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ilan Peer Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Ilan Peer When processing the NL80211_CMD_PROBE_CLIENT command, the nl80211 layer in the kernel sends a response containing the cookie associated with the client probe request. This response is not handled by driver_nl80211 when sending the command, and is mistakenly handled as an asynchronous event. Fix this by reading the response as part of the sending the command flow. Signed-off-by: Ilan Peer --- src/drivers/driver_nl80211.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 52cef41865..064d73fe81 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -8260,6 +8260,7 @@ static void nl80211_poll_client(void *priv, const u8 *own_addr, const u8 *addr, struct i802_bss *bss = priv; struct wpa_driver_nl80211_data *drv = bss->drv; struct nl_msg *msg; + u64 cookie; int ret; if (!drv->poll_command_supported) { @@ -8273,11 +8274,15 @@ static void nl80211_poll_client(void *priv, const u8 *own_addr, const u8 *addr, return; } - ret = send_and_recv_msgs(drv, msg, NULL, NULL); + ret = send_and_recv_msgs(drv, msg, cookie_handler, &cookie); if (ret < 0) { wpa_printf(MSG_DEBUG, "nl80211: Client probe request for " MACSTR " failed: ret=%d (%s)", MAC2STR(addr), ret, strerror(-ret)); + } else { + wpa_printf(MSG_DEBUG, + "nl80211: Client probe request cookie=%lu", + cookie); } }