From patchwork Thu Jan 11 07:49:00 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: 1886328 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=hb25efQh; 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=bmjzmhcq; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=198.137.202.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 [198.137.202.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 4TBsnY3xCnz1yP3 for ; Sat, 13 Jan 2024 20:00:47 +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=jQ9Zo4gTVei7b5nuXbxX9RmIrYn+Arxl7BAPmM0sJ7g=; b=hb25efQhvTEtUF Gg0A0CC5TVsWe4tOEC8/3ZEJKkr61A+fhEgi2itzSxaamV9l6eTEPRVHWOHqZd5jsL6w0PLOHo2lW 6k4/eYL0hPFJQLYl0Y3bFxkAB1iig4cH2sSQq9H4FlXXNSoBvcmPKNQXE1lJv0mEpZxKdzNojlEDB E1b1ERhlmOBExrZA/+b64w13GYGERoprchj4GbKiiiYmhc1WaZ7uX7PggimxdJkLWK0e7PWKRhM12 kr3Yns14cwK/I8AwoLknk9oEEKLe1ufRuJ9ztd7ndOmMWdSMyGbmCVwcgZgZmTs7wtIRhxJiHB3KP Zz8e1Hg+cISr0eqo8V6w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rOZmo-004niM-2Z; Sat, 13 Jan 2024 08:54:38 +0000 Received: from m16.mail.163.com ([220.197.31.2]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rNq2z-00GPQk-1O for hostap@lists.infradead.org; Thu, 11 Jan 2024 08:04:19 +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=LFmgia3M6n9KgN8rRA3z/ChU4YIT/JyrM3693u+d2QY=; b=b mjzmhcqBp+d82fv/kPzB+gmeVOCPpRfhBnw1QSQ1fFk6mhjlAFgWbxUKD8ExbqdY b7ii2SqpCCpaZodeS516xQwlFBk5WABx0PalMnwMsS7xydfu8ZiorhcCJaGE51QI dD7KHodQaByerHHyGiOBC3vKTg5OPR2pebCyGbKn/A= Received: from zhuhai.mail$163.com ( [222.128.5.184] ) by ajax-webmail-wmsvr-40-107 (Coremail) ; Thu, 11 Jan 2024 15:49:00 +0800 (CST) X-Originating-IP: [222.128.5.184] Date: Thu, 11 Jan 2024 15:49:00 +0800 (CST) From: =?utf-8?b?5pyx5rW3?= To: hostap@lists.infradead.org Subject: [PATCH] Fix a logical error of workaround of listen failure 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_Qu2bBvWetksv5iWYbOkfm0kRgeo7XcG1sv0i2oNSOJtwjCHp1xAxdG1RM3Xc3s+rCCq2lgqFczhp88VVfJZbUa8x1e7naBc+LvsUisBl0MM7YQ== MIME-Version: 1.0 Message-ID: <69609765.5b65.18cf77eefe4.Coremail.zhuhai.mail@163.com> X-Coremail-Locale: zh_CN X-CM-TRANSID: _____wDXf3FsnZ9l7xIwAA--.3680W X-CM-SenderInfo: x2kxxt3loptxro6rljoofrz/1tbiyQ9ipWV4HToCdgABsO X-Coremail-Antispam: 1U5529EdanIXcx71UUUUU7vcSsGvfC2KfnxnUU== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240111_000417_889213_E97E9328 X-CRM114-Status: UNSURE ( 8.30 ) 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: when p2p->state == P2P_LISTEN_ONLY is true, the statement before it 'p2p->cfg->is_p2p_in_progress(p2p->cfg->cb_ctx)' will be true too, so this function will print a message "Operation in progress" and [...] Content analysis details: (0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [zhuhai.mail[at]163.com] 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 X-Mailman-Approved-At: Sat, 13 Jan 2024 00:54:37 -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 when p2p->state == P2P_LISTEN_ONLY is true, the statement before it 'p2p->cfg->is_p2p_in_progress(p2p->cfg->cb_ctx)' will be true too, so this function will print a message "Operation in progress" and return, the workaround to handle listen failure will be never reached. I had met such error, the 'remain-on-channel' command failed, then the function p2p_ext_listen_timeout just printed 'Operation in progress' again and again, the listen was not started anymore. Signed-off-by: zhuhai --- src/p2p/p2p.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) -- 2.42.0 diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index 7e11abff4..1327a56b8 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -4662,15 +4662,6 @@ static void p2p_ext_listen_timeout(void *eloop_ctx, void *timeout_ctx) p2p_ext_listen_timeout, p2p, NULL); } - if ((p2p->cfg->is_p2p_in_progress && - p2p->cfg->is_p2p_in_progress(p2p->cfg->cb_ctx)) || - (p2p->pending_action_state == P2P_PENDING_PD && - p2p->pd_retries > 0)) { - p2p_dbg(p2p, "Operation in progress - skip Extended Listen timeout (%s)", - p2p_state_txt(p2p->state)); - return; - } - if (p2p->state == P2P_LISTEN_ONLY && p2p->ext_listen_only) { /* * This should not really happen, but it looks like the Listen @@ -4683,6 +4674,15 @@ static void p2p_ext_listen_timeout(void *eloop_ctx, void *timeout_ctx) p2p_set_state(p2p, P2P_IDLE); } + if ((p2p->cfg->is_p2p_in_progress && + p2p->cfg->is_p2p_in_progress(p2p->cfg->cb_ctx)) || + (p2p->pending_action_state == P2P_PENDING_PD && + p2p->pd_retries > 0)) { + p2p_dbg(p2p, "Operation in progress - skip Extended Listen timeout (%s)", + p2p_state_txt(p2p->state)); + return; + } + if (p2p->state != P2P_IDLE) { p2p_dbg(p2p, "Skip Extended Listen timeout in active state (%s)", p2p_state_txt(p2p->state)); return;