[][MAC80211][hostapd][Add the broadcast address of Probe Response frame on 6 GHz]

[Description]
Add the broadcast destination address of Probe Response frame on 6 GHz.

According to IEEE 802.11ax 26.17.2.3.2,
if a 6 GHz AP receives a Probe Request frame and responds with
a Probe Response frame, the Address 1 field of the Probe Response
frame shall be set to the broadcast address,
unless the AP is not indicating its actual SSID inthe SSID element
of its Beacon frames.

Without this, hostapd fill the Address 1 feild of the Probe Response
frame with the source address from Probe Request frame on 6 GHz.
Fix this to use broadcast address instead.

[Release-log]
N/A

Change-Id: I12e30f8fd179f20037879dffe24c0118636d0a89
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/7057107
diff --git a/autobuild_mac80211_release/package/network/services/hostapd/patches/99912-hostapd-mtk-Add-the-broadcast-destination-address-of.patch b/autobuild_mac80211_release/package/network/services/hostapd/patches/99912-hostapd-mtk-Add-the-broadcast-destination-address-of.patch
new file mode 100644
index 0000000..df9dcc5
--- /dev/null
+++ b/autobuild_mac80211_release/package/network/services/hostapd/patches/99912-hostapd-mtk-Add-the-broadcast-destination-address-of.patch
@@ -0,0 +1,43 @@
+From 9c04bbbe2677cc11b88c867ab7b1df7e408483b5 Mon Sep 17 00:00:00 2001
+From: MeiChia Chiu <meichia.chiu@mediatek.com>
+Date: Tue, 17 Jan 2023 13:25:18 +0800
+Subject: [PATCH] hostapd: mtk: Add the broadcast destination address of Probe
+ Response frame on 6 GHz
+
+According to IEEE 802.11ax 26.17.2.3.2,
+if a 6 GHz AP receives a Probe Request frame and responds with a Probe Response frame,
+the Address 1 field of the Probe Response frame shall be set to the broadcast address,
+unless the AP is not indicating its actual SSID in the SSID element of its Beacon frames.
+
+Without this, hostapd fill the Address 1 feild of the Probe Response frame
+with the source address from Probe Request frame on 6 GHz.
+Fix this to use broadcast address instead.
+
+Signed-off-by: MeiChia Chiu <meichia.chiu@mediatek.com>
+---
+ src/ap/beacon.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/ap/beacon.c b/src/ap/beacon.c
+index 1a26f11..f3ea5c2 100644
+--- a/src/ap/beacon.c
++++ b/src/ap/beacon.c
+@@ -1156,8 +1156,13 @@ void handle_probe_req(struct hostapd_data *hapd,
+ 	wpa_msg_ctrl(hapd->msg_ctx, MSG_INFO, RX_PROBE_REQUEST "sa=" MACSTR
+ 		     " signal=%d", MAC2STR(mgmt->sa), ssi_signal);
+ 
+-	resp = hostapd_gen_probe_resp(hapd, mgmt, elems.p2p != NULL,
+-				      &resp_len, false);
++	if (is_6ghz_op_class(hapd->iconf->op_class) &&
++	    is_broadcast_ether_addr(mgmt->da))
++		resp = hostapd_gen_probe_resp(hapd, NULL, elems.p2p != NULL,
++					      &resp_len, true);
++	else
++		resp = hostapd_gen_probe_resp(hapd, mgmt, elems.p2p != NULL,
++					      &resp_len, false);
+ 	if (resp == NULL)
+ 		return;
+ 
+-- 
+2.39.0
+