[PATCH] nl80211: Clear preq NL handle after Unsbcsribe mgmt

Ouden Lin ouden.biz at gmail.com
Sun Nov 21 20:04:12 PST 2021


From: Ouden <Ouden.Biz at gmail.com>

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 <Ouden.Biz at gmail.com>
---
 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;
-- 
2.30.2




More information about the Hostap mailing list