From patchwork Wed Jan 31 12:58:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5pyx5rW3?= X-Patchwork-Id: 1893609 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=lS1hjWYY; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=HbR3O0y2; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TQ8Gl4sHnz23g7 for ; Thu, 1 Feb 2024 04:31:41 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Message-ID:MIME-Version:Subject:To:From :Date:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=I/yoNKQPp0z2PlFpTnfKYKUPh4YIoDDf8je1BPlp/nk=; b=lS1hjWYYKJ9h0i POIdKDIGrFk/gJ3NsKWXzD8fyUgMRIDsSqr2bi9jPag/HcVhOqPpdGh4ZcYWGZcW9g8L4dRPdssm6 TcnnUNgoTJa4OEuNURmJ8f89Lxk1+FtSzUm55Ph6ajHNGJPjShJWYwqa/2h7HbVb0eq94yjOj0lgJ A/7HbVPecfUYJK7GgHinh1IQaUCwXPeZ8ygNvmKX9b/WnTSyL1JstWwq3GUmHAs2IAK+JgikXtQiP EmqAAbMVz9Z8WLBD0AW7eqnS10CWSAKb2GDgx58eG8AXPDTqPBUZI56nINDf1RKZqFXh4u1+rRfxK HB/KeLnGqZP94CDtq26Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rVEQb-00000004qDV-470a; Wed, 31 Jan 2024 17:31:13 +0000 Received: from m16.mail.163.com ([220.197.31.2]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rVAPd-00000003YqP-36Qz for hostap@lists.infradead.org; Wed, 31 Jan 2024 13:13:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Date:From:Subject:Content-Type:MIME-Version: Message-ID; bh=4ha767TC7otYRX1Kqy04llkwschq62NE4CKKFDKiBJI=; b=H bR3O0y2wNqXMqbG8jReK2v6aGeHlOtMGHllJ8e8EdwbvyEXJWT02O/GQ9UKip+/U I9kesDDSS1O/oXd9SnDFY+K0WokIUbukEVEPaT+ax1qyGzpvFWGvbM1BKxMKmGml t3ESjubydBFPSmjeLqLIHB0zoBjTIOMXB7eH74E49E= Received: from zhuhai.mail$163.com ( [221.223.24.194] ) by ajax-webmail-wmsvr-40-119 (Coremail) ; Wed, 31 Jan 2024 20:58:47 +0800 (CST) X-Originating-IP: [221.223.24.194] Date: Wed, 31 Jan 2024 20:58:47 +0800 (CST) From: =?utf-8?b?5pyx5rW3?= To: hostap@lists.infradead.org Subject: [PATCH] Clear pending_listen_freq if listen failed X-Priority: 3 X-Mailer: Coremail Webmail Server Version XT5.0.14 build 20230109(dcb5de15) Copyright (c) 2002-2024 www.mailtech.cn 163com X-NTES-SC: AL_Qu2bBPubukEp4SSfYekfm08Vhe0/UcG2uf4k3oVVN5h+jD7p6ykqWlllGF718sKrKgqynT6xahNl1NR+cY1ZY7k5WWAai2Or3vMRYcOuk7BY8Q== MIME-Version: 1.0 Message-ID: <41751eb.9a02.18d5f99bd36.Coremail.zhuhai.mail@163.com> X-Coremail-Locale: zh_CN X-CM-TRANSID: _____wC3H2gHRLplKdCtAA--.29635W X-CM-SenderInfo: x2kxxt3loptxro6rljoofrz/1tbiNBR2pWVOBXr1KwACs7 X-Coremail-Antispam: 1U5529EdanIXcx71UUUUU7vcSsGvfC2KfnxnUU== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240131_051358_183003_64D609F8 X-CRM114-Status: UNSURE ( 8.17 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: p2p_listen use p2p->pending_listen_freq to check if having a pending p2p_listen request. but this value is not cleared when listen started failed, making extended listen not work anymore. P2P: Failed to request the driver to remain on channel (2412 MHz) for Listen state p2p-dev-wlan0: Radio work 'p2p-listen'@0xa800d510 done in 0.005055 seconds p2p-dev-wlan0: radio_work_free('p2p-listen [...] Content analysis details: (0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.1 DKIM_INVALID DKIM or DK signature exists, but is not valid 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [zhuhai.mail(at)163.com] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Mailman-Approved-At: Wed, 31 Jan 2024 09:31:12 -0800 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org p2p_listen use p2p->pending_listen_freq to check if having a pending p2p_listen request. but this value is not cleared when listen started failed, making extended listen not work anymore. P2P: Failed to request the driver to remain on channel (2412 MHz) for Listen state p2p-dev-wlan0: Radio work 'p2p-listen'@0xa800d510 done in 0.005055 seconds p2p-dev-wlan0: radio_work_free('p2p-listen'@0xa800d510: num_active_works --> 0 P2P: Previous Extended Listen operation had not been completed - try again P2P: State LISTEN_ONLY -> IDLE P2P: Extended Listen timeout P2P: Going to listen(only) state P2P: p2p_listen command pending already Signed-off-by: zhuhai --- src/p2p/p2p.c | 10 ++++++++++ src/p2p/p2p.h | 2 ++ wpa_supplicant/p2p_supplicant.c | 2 ++ 3 files changed, 14 insertions(+) diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index bb1938dc3..e05196833 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -3964,6 +3964,16 @@ int p2p_listen_end(struct p2p_data *p2p, unsigned int freq) return 0; } +void p2p_listen_failed(struct p2p_data *p2p, unsigned int freq) +{ + if (freq != p2p->pending_listen_freq) { + p2p_dbg(p2p, "Unexpected listen failed callback for freq=%u (pending_listen_freq=%u)", + freq, p2p->pending_listen_freq); + return; + } + p2p_dbg(p2p, "Listen failed on freq=%u", freq); + p2p->pending_listen_freq = 0; +} static void p2p_timeout_connect(struct p2p_data *p2p) { diff --git a/src/p2p/p2p.h b/src/p2p/p2p.h index 27bdac3bf..c1631a237 100644 --- a/src/p2p/p2p.h +++ b/src/p2p/p2p.h @@ -1687,6 +1687,8 @@ void p2p_listen_cb(struct p2p_data *p2p, unsigned int freq, */ int p2p_listen_end(struct p2p_data *p2p, unsigned int freq); +void p2p_listen_failed(struct p2p_data *p2p, unsigned int freq); + void p2p_deauth_notif(struct p2p_data *p2p, const u8 *bssid, u16 reason_code, const u8 *ie, size_t ie_len); diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 0904d60ef..a39380d31 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -2714,6 +2714,7 @@ static void wpas_start_listen_cb(struct wpa_radio_work *work, int deinit) if (wpa_drv_probe_req_report(wpa_s, 1) < 0) { wpa_printf(MSG_DEBUG, "P2P: Failed to request the driver to " "report received Probe Request frames"); + p2p_listen_failed(wpa_s->global->p2p, lwork->freq); wpas_p2p_listen_work_done(wpa_s); return; } @@ -2734,6 +2735,7 @@ static void wpas_start_listen_cb(struct wpa_radio_work *work, int deinit) wpa_printf(MSG_DEBUG, "P2P: Failed to request the driver " "to remain on channel (%u MHz) for Listen " "state", lwork->freq); + p2p_listen_failed(wpa_s->global->p2p, lwork->freq); wpas_p2p_listen_work_done(wpa_s); wpa_s->pending_listen_freq = 0; return;