FST: Update FST about MAC address change

Notify FST module upon MAC address change. FST module will update the
Multiband IE accordingly.

Signed-off-by: Dedy Lansky <dlansky@codeaurora.org>
This commit is contained in:
Dedy Lansky 2019-09-10 12:53:55 +03:00 committed by Jouni Malinen
parent 49e95ee1ee
commit cdb5774f42
3 changed files with 21 additions and 0 deletions

View file

@ -214,6 +214,15 @@ Boolean fst_are_ifaces_aggregated(struct fst_iface *iface1,
}
void fst_update_mac_addr(struct fst_iface *iface, const u8 *addr)
{
fst_printf_iface(iface, MSG_DEBUG, "new MAC address " MACSTR,
MAC2STR(addr));
os_memcpy(iface->own_addr, addr, sizeof(iface->own_addr));
fst_group_update_ie(fst_iface_get_group(iface));
}
enum mb_band_id fst_hw_mode_to_band(enum hostapd_hw_mode mode)
{
switch (mode) {

View file

@ -279,6 +279,13 @@ void fst_notify_peer_disconnected(struct fst_iface *iface, const u8 *addr);
Boolean fst_are_ifaces_aggregated(struct fst_iface *iface1,
struct fst_iface *iface2);
/**
* fst_update_mac_addr - Notify FST about MAC address change
* @iface: FST interface object
* @addr: New MAC address
*/
void fst_update_mac_addr(struct fst_iface *iface, const u8 *addr);
#else /* CONFIG_FST */
static inline int fst_global_init(void)

View file

@ -4608,6 +4608,11 @@ int wpa_supplicant_update_mac_addr(struct wpa_supplicant *wpa_s)
wpa_sm_set_own_addr(wpa_s->wpa, wpa_s->own_addr);
wpas_wps_update_mac_addr(wpa_s);
#ifdef CONFIG_FST
if (wpa_s->fst)
fst_update_mac_addr(wpa_s->fst, wpa_s->own_addr);
#endif /* CONFIG_FST */
return 0;
}