diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c index e7cba4847..7a62f96d6 100644 --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c @@ -4869,6 +4869,9 @@ static const struct global_parse_data global_fields[] = { { INT_RANGE(gas_rand_mac_addr, 0, 2), 0 }, { INT_RANGE(dpp_config_processing, 0, 2), 0 }, { INT_RANGE(coloc_intf_reporting, 0, 1), 0 }, +#ifdef CONFIG_WNM + { INT_RANGE(disable_btm, 0, 1), CFG_CHANGED_DISABLE_BTM }, +#endif /* CONFIG_WNM */ }; #undef FUNC diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h index abbd8c90e..6a297ecfe 100644 --- a/wpa_supplicant/config.h +++ b/wpa_supplicant/config.h @@ -374,6 +374,7 @@ struct wpa_cred { #define CFG_CHANGED_P2P_PASSPHRASE_LEN BIT(16) #define CFG_CHANGED_SCHED_SCAN_PLANS BIT(17) #define CFG_CHANGED_WOWLAN_TRIGGERS BIT(18) +#define CFG_CHANGED_DISABLE_BTM BIT(19) /** * struct wpa_config - wpa_supplicant configuration data @@ -1527,6 +1528,15 @@ struct wpa_config { * By default, permanent MAC address is used. */ int p2p_interface_random_mac_addr; + + /** + * disable_btm - Disable BSS transition management in STA + * - Set to 0 to enable BSS transition management + * - Set to 1 to disable BSS transition management + * + * By default BSS transition management is enabled + */ + int disable_btm; }; diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c index fe5a0115a..77c326df5 100644 --- a/wpa_supplicant/config_file.c +++ b/wpa_supplicant/config_file.c @@ -1545,6 +1545,8 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config) if (config->p2p_interface_random_mac_addr) fprintf(f, "p2p_interface_random_mac_addr=%d\n", config->p2p_interface_random_mac_addr); + if (config->disable_btm) + fprintf(f, "disable_btm=1\n"); } #endif /* CONFIG_NO_CONFIG_WRITE */ diff --git a/wpa_supplicant/wnm_sta.c b/wpa_supplicant/wnm_sta.c index f5a4cb739..c14764963 100644 --- a/wpa_supplicant/wnm_sta.c +++ b/wpa_supplicant/wnm_sta.c @@ -1371,6 +1371,9 @@ static void ieee802_11_rx_bss_trans_mgmt_req(struct wpa_supplicant *wpa_s, const u8 *vendor; #endif /* CONFIG_MBO */ + if (wpa_s->conf->disable_btm) + return; + if (end - pos < 5) return; diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index f82d18fe2..2002b129f 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -1711,7 +1711,8 @@ static void wpas_ext_capab_byte(struct wpa_supplicant *wpa_s, u8 *pos, int idx) case 2: /* Bits 16-23 */ #ifdef CONFIG_WNM *pos |= 0x02; /* Bit 17 - WNM-Sleep Mode */ - *pos |= 0x08; /* Bit 19 - BSS Transition */ + if (!wpa_s->conf->disable_btm) + *pos |= 0x08; /* Bit 19 - BSS Transition */ #endif /* CONFIG_WNM */ break; case 3: /* Bits 24-31 */ @@ -6630,6 +6631,9 @@ void wpa_supplicant_update_config(struct wpa_supplicant *wpa_s) wpa_s->conf->wowlan_triggers); } + if (wpa_s->conf->changed_parameters & CFG_CHANGED_DISABLE_BTM) + wpa_supplicant_set_default_scan_ies(wpa_s); + #ifdef CONFIG_WPS wpas_wps_update_config(wpa_s); #endif /* CONFIG_WPS */ diff --git a/wpa_supplicant/wpa_supplicant.conf b/wpa_supplicant/wpa_supplicant.conf index 842a8dbe0..1159bdcdc 100644 --- a/wpa_supplicant/wpa_supplicant.conf +++ b/wpa_supplicant/wpa_supplicant.conf @@ -1516,6 +1516,12 @@ fast_reauth=1 # Transitioning between states). #fst_llt=100 +# BSS Transition Management +# disable_btm - Disable BSS transition management in STA +# Set to 0 to enable BSS transition management (default behavior) +# Set to 1 to disable BSS transition management +#disable_btm=0 + # Example blocks: # Simple case: WPA-PSK, PSK as an ASCII passphrase, allow all valid ciphers