]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Update Probe Response template on BSS color change
authorRathees Kumar R Chinannan <quic_rrchinan@quicinc.com>
Mon, 8 Apr 2024 06:35:16 +0000 (12:05 +0530)
committerJouni Malinen <j@w1.fi>
Wed, 24 Apr 2024 18:58:49 +0000 (21:58 +0300)
When AP is beaconing only on the 6 GHz band and unsol_bcast_presp
interval is set, AP sends unsolicited broadcast Probe Response frames
for in-band discovery. hostapd sent the Probe Response template for this
frame only when setting a new Beacon frame template.

Extend this to update the Probe Response template during BSS color
change.

Signed-off-by: Rathees Kumar R Chinannan <quic_rrchinan@quicinc.com>
src/ap/hostapd.c
src/drivers/driver.h
src/drivers/driver_nl80211.c

index 14c225bf69418b999fa7c3d45de074827f7c9a8b..0506b418f423a3fee945a098e460acaab5b9e426 100644 (file)
@@ -4571,6 +4571,9 @@ static int hostapd_fill_cca_settings(struct hostapd_data *hapd,
                return ret;
        }
 
+       settings->ubpr.unsol_bcast_probe_resp_tmpl =
+               hostapd_unsol_bcast_probe_resp(hapd, &settings->ubpr);
+
        settings->counter_offset_beacon = hapd->cca_c_off_beacon;
        settings->counter_offset_presp = hapd->cca_c_off_proberesp;
 
@@ -4633,6 +4636,7 @@ static void hostapd_switch_color_timeout_handler(void *eloop_data,
 
                free_beacon_data(&settings.beacon_cca);
                free_beacon_data(&settings.beacon_after);
+               os_free(settings.ubpr.unsol_bcast_probe_resp_tmpl);
        }
 }
 
index d467e94d50f4da9407a81029a45f19f0d55fe823..568f338b073a2ec94cd797335cadcf5218f312eb 100644 (file)
@@ -2760,6 +2760,7 @@ struct csa_settings {
  * @beacon_after: Next Beacon/Probe Response/(Re)Association Response frame info
  * @counter_offset_beacon: Offset to the count field in Beacon frame tail
  * @counter_offset_presp: Offset to the count field in Probe Response frame
+ * @ubpr: Unsolicited broadcast Probe Response frame data
  */
 struct cca_settings {
        u8 cca_count;
@@ -2770,6 +2771,8 @@ struct cca_settings {
 
        u16 counter_offset_beacon;
        u16 counter_offset_presp;
+
+       struct unsol_bcast_probe_resp ubpr;
 };
 
 /* TDLS peer capabilities for send_tdls_mgmt() */
index 5ef790f312a31352c74a7cd1a486ecc37428e6ea..149f51a74c90d0a8904b7778690b013f58c56346 100644 (file)
@@ -11396,6 +11396,13 @@ static int nl80211_switch_color(void *priv, struct cca_settings *settings)
        }
 
        nla_nest_end(msg, beacon_cca);
+
+       if (settings->ubpr.unsol_bcast_probe_resp_interval &&
+           nl80211_unsol_bcast_probe_resp(bss, msg, &settings->ubpr) < 0) {
+               ret = -ENOBUFS;
+               goto error;
+       }
+
        ret = send_and_recv_cmd(drv, msg);
        if (ret) {
                wpa_printf(MSG_DEBUG,