From patchwork Mon Nov 22 04:04:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ouden Lin X-Patchwork-Id: 1557873 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=VAKIZlG8; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=fL0eNygr; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) 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=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HyDJ93XhRz9sf8 for ; Mon, 22 Nov 2021 15:07:37 +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:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=+/BoRw+tj7eS+e7SqsNrxd0FkLbmfQBKwn0PwpvqCS0=; b=VAKIZlG83mIdRs NAcvLiG3ECjZF42cqXOs2KAmP/NNVLEWQEwTrPHyQT7EWqszjxds8Z/mnfoyjRWlg209x/4Zd+nFK rkCjXQEiOcOFVD5TqfiE/tUf9pDdl/pjf0kQCREnWQOHtM36gS+LuoB7LYhQ1szIRwMGxoppUhC96 cwEadfDJsGP4SpeQ0Nvy9voRkrNO8b8xMzxmuw5j20UUzEuPvJBuQD72U0cHz7WwaHxxSgcceRjAB lThGFhEAYUEJ4yWqOAWjJbzuKLY7nA6NZrxmFvvWPjtcNpk+wO6sdCga+l6sHHOfhG2L4ahjHY9+P 6WN4UnUYnxMWsly4nJ8A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mp0ZD-00EmtV-78; Mon, 22 Nov 2021 04:04:31 +0000 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mp0Z8-00EmtA-S2 for hostap@lists.infradead.org; Mon, 22 Nov 2021 04:04:28 +0000 Received: by mail-pl1-x629.google.com with SMTP id o14so12951371plg.5 for ; Sun, 21 Nov 2021 20:04:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xSL4nJfKZahBSNeSdDWcITY6Ve9AdNMT2EcB/MEBLBI=; b=fL0eNygrVtSgXuentrmGUsiU9EqzhbIPW/PoZlCZzwnBMeafkTrvj0S6rB9X2bJsZs 1VsH5kOcSmgIhMRhaeXalQTFdMQFo7quIWh31lheZPwLRE+19uqvbO7/oUgsLSalGjwT +U2m/6L9V5KO28X/h03HNhW2Mk9Rs/+cLz29XA/oED3Ores+Z2l7vbwqo5h0t7kx/l4G 4p/fMPS4OH6P5wXBEleohYhpU3tJcDkRO4vG4xRgti1ZYYb+8a5HXElyKwGIMGCdTItF h76V1w45BS9zusKwsKubHr2UYjTTznaX+Ep9t/0J6IUbz8y062nqQptgMnEv/PjkaLjS vlDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xSL4nJfKZahBSNeSdDWcITY6Ve9AdNMT2EcB/MEBLBI=; b=M+Buv0qUE0MNjxDqOWeEt6mUAZIFEZchm6DL+XiPzvWNZoBxyMWxm55XCUlHZKNT1g D6IZVMBSdb/MgHlcV+4A6/quJ6QSy426tP/wOzuvUrVFWen3P1AC9tDUNLBxgSEwxwRv 1h65gWZjG0KgOfCEwSCz6A4JFLr6ZjfqhhqvKTPeRB+3FQ2CKnyIlC1Bc2WkuWKgxV2l mA7Qpru+is3SEm3U5MvjWCI+BtsFJqH4sUnOVtcTVreAPfynNoL6ZE3wJ9Q5r41fEJqG rFKukG9YnFt1W1QNFU6LY4a35Rodh+yiqHvdIknEG09NRekefr6PsuICNXnZeb6O59ax NWfQ== X-Gm-Message-State: AOAM530J3m40hbwK+4Sxr4ZH/PGXlBLjo7HfGtcgSxmterAa+MYLcUr6 E/xgrBSPlBhCdIqQBzpt74NOliPgz3OTbA== X-Google-Smtp-Source: ABdhPJy8KcuzZjgQtxtlyryrgngm0TAjALdovF5Xsg5dkwD5dwp+ExGo24jkN53KwSiV2mBhFyNBgQ== X-Received: by 2002:a17:902:c115:b0:142:2441:aa23 with SMTP id 21-20020a170902c11500b001422441aa23mr100845892pli.16.1637553865056; Sun, 21 Nov 2021 20:04:25 -0800 (PST) Received: from localhost.localdomain (2001-b400-e338-5db6-dc29-bd69-7d1c-90f0.emome-ip6.hinet.net. [2001:b400:e338:5db6:dc29:bd69:7d1c:90f0]) by smtp.gmail.com with ESMTPSA id x33sm6874499pfh.133.2021.11.21.20.04.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Nov 2021 20:04:24 -0800 (PST) From: Ouden Lin X-Google-Original-From: Ouden Lin To: hostap@lists.infradead.org Cc: Ouden Subject: [PATCH] nl80211: Clear preq NL handle after Unsbcsribe mgmt Date: Mon, 22 Nov 2021 12:04:12 +0800 Message-Id: <20211122040412.17008-1-ouden.lin@realtek.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211121_200426_976004_128E025C X-CRM114-Status: GOOD ( 11.61 ) 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: From: Ouden When entering the P2P connection, the radio working "p2p-listen" will enable and disable the probe request report. This will set and clear the pointer nl_preq. In the state WAIT_PEER_CONNECT that init [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:629 listed in] [list.dnswl.org] -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 [ouden.biz[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 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 From: Ouden When entering the P2P connection, the radio working "p2p-listen" will enable and disable the probe request report. This will set and clear the pointer nl_preq. In the state WAIT_PEER_CONNECT that initiates the negotiation, the disable probe request report will not be triggered. At the start of GO (start AP), Unsbcsribe mgmt will delete all management reports, including Probe Requst, However, nl_preq is still not deleted. Finally, Go cannot enable probe request reporting until the trigger is disabled. This patch will check nl_preq after Unsubscribe mgmt. Logs for as: P2P: Go to Listen state while waiting for the peer to become ready for GO Negotiation P2P: State WAIT_PEER_IDLE -> WAIT_PEER_CONNECT P2P: Starting short listen state (state=WAIT_PEER_CONNECT) nl80211: Enable Probe Request reporting nl_preq=0x562934543420 nl80211: Register frame type=0x40 (WLAN_FC_STYPE_PROBE_REQ) nl_handle=0x562934543420 match= P2P: GO Negotiation with 00:AA:BB:0b:f0:3b P2P: State WAIT_PEER_CONNECT -> IDLE P2P: Skip stop_listen since we are on correct channel for response P2P: State IDLE -> GO_NEG Change-Id: I318ead337928e0f757bfaddfe808d967b05069b0 nl80211: Setup AP operations for P2P group (GO) nl80211: Unsubscribe mgmt frames handle 0x8888dea1bcc6c2c9 (start AP) nl80211: Setup AP(wlan1) - device_ap_sme=1 use_monitor=0 nl80211: Subscribe to mgmt frames with AP handle 0x5629344e4a40 (device SME) nl80211: Probe Request reporting already on! nl_preq=0x8888dea1bcdcbca9 Signed-off-by: Ouden --- src/drivers/driver_nl80211.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 9a9a146f7..48d278f17 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -6721,6 +6721,11 @@ done: if (is_ap_interface(nlmode)) { nl80211_mgmt_unsubscribe(bss, "start AP"); + if (bss->nl_preq) { + wpa_printf(MSG_DEBUG, "nl80211: Disable Probe Request " + "reporting nl_preq=%p", bss->nl_preq); + nl80211_destroy_eloop_handle(&bss->nl_preq, 0); + } /* Setup additional AP mode functionality if needed */ if (nl80211_setup_ap(bss)) return -1;