]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
FST: Update FST about MAC address change
authorDedy Lansky <dlansky@codeaurora.org>
Tue, 10 Sep 2019 09:53:55 +0000 (12:53 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 15 Oct 2019 12:39:22 +0000 (15:39 +0300)
Notify FST module upon MAC address change. FST module will update the
Multiband IE accordingly.

Signed-off-by: Dedy Lansky <dlansky@codeaurora.org>
src/fst/fst.c
src/fst/fst.h
wpa_supplicant/wpa_supplicant.c

index 32cd941b41e243dc05206601c45d4fc929efcd6b..fbe1175ac09e45991c47dbaa6caf2ded8b93c399 100644 (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) {
index 296749120b2a10697d8c66318dc4681579093f66..7ba60d5454f568c206dd049099f5024176acdbaa 100644 (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)
index 09c36097f370dbecbbf1b2afb8e198fc93f8a3df..29f482038c37ddac80d8a7a83416e32491a597c1 100644 (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;
 }