blob: e9b630f1a2a05dd8a1a8dcd19b6ad9bd529ed704 [file] [log] [blame]
developerf32dabf2022-06-01 10:59:24 +08001From 96a7f383290f78e15f1e7a5bc33099c81f104c5b Mon Sep 17 00:00:00 2001
2From: MeiChia Chiu <meichia.chiu@mediatek.com>
3Date: Fri, 6 May 2022 11:02:36 +0800
4Subject: hostapd: Add the destination address of unsolicited Probe Response
5 frame
6
7Without this, hostapd generates Probe Response frames with the null
8destination address when hostapd enables unsolicited Probe Response
9frame transmission. Fix this to use the broadcast address instead.
10
11Fixes: 024b4b2a298f ("AP: Unsolicited broadcast Probe Response configuration")
12Signed-off-by: MeiChia Chiu <meichia.chiu@mediatek.com>
13---
14 src/ap/beacon.c | 13 +++++++++----
15 1 file changed, 9 insertions(+), 4 deletions(-)
16
17diff --git a/src/ap/beacon.c b/src/ap/beacon.c
18index eaa403326..58872bfda 100644
19--- a/src/ap/beacon.c
20+++ b/src/ap/beacon.c
21@@ -464,7 +464,8 @@ static u8 * hostapd_eid_supported_op_classes(struct hostapd_data *hapd, u8 *eid)
22
23 static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd,
24 const struct ieee80211_mgmt *req,
25- int is_p2p, size_t *resp_len)
26+ int is_p2p, size_t *resp_len,
27+ bool bcast_probe_resp)
28 {
29 struct ieee80211_mgmt *resp;
30 u8 *pos, *epos, *csa_pos;
31@@ -531,6 +532,9 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd,
32 WLAN_FC_STYPE_PROBE_RESP);
33 if (req)
34 os_memcpy(resp->da, req->sa, ETH_ALEN);
35+ else if (bcast_probe_resp)
36+ os_memset(resp->da, 0xff, ETH_ALEN);
37+
38 os_memcpy(resp->sa, hapd->own_addr, ETH_ALEN);
39
40 os_memcpy(resp->bssid, hapd->own_addr, ETH_ALEN);
41@@ -1141,7 +1145,7 @@ void handle_probe_req(struct hostapd_data *hapd,
42 " signal=%d", MAC2STR(mgmt->sa), ssi_signal);
43
44 resp = hostapd_gen_probe_resp(hapd, mgmt, elems.p2p != NULL,
45- &resp_len);
46+ &resp_len, false);
47 if (resp == NULL)
48 return;
49
50@@ -1210,7 +1214,7 @@ static u8 * hostapd_probe_resp_offloads(struct hostapd_data *hapd,
51 "this");
52
53 /* Generate a Probe Response template for the non-P2P case */
54- return hostapd_gen_probe_resp(hapd, NULL, 0, resp_len);
55+ return hostapd_gen_probe_resp(hapd, NULL, 0, resp_len, false);
56 }
57
58 #endif /* NEED_AP_MLME */
59@@ -1228,7 +1232,8 @@ static u8 * hostapd_unsol_bcast_probe_resp(struct hostapd_data *hapd,
60 hapd->conf->unsol_bcast_probe_resp_interval;
61
62 return hostapd_gen_probe_resp(hapd, NULL, 0,
63- &params->unsol_bcast_probe_resp_tmpl_len);
64+ &params->unsol_bcast_probe_resp_tmpl_len,
65+ true);
66 }
67 #endif /* CONFIG_IEEE80211AX */
68
69--
70cgit v1.2.3-18-g5258
71