aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikael Kanstrup <mikael.kanstrup@sony.com>2019-08-16 06:50:54 (GMT)
committerJouni Malinen <j@w1.fi>2019-09-09 13:49:34 (GMT)
commit8788a314d7897c90195c6f94810f55b2ba6e7190 (patch)
tree0b16494d33d1ccb11d0f4bdc8e02fc425a8a8382
parent39042d7f7c4997af55474ebe4513c81f00732837 (diff)
downloadhostap-8788a314d7897c90195c6f94810f55b2ba6e7190.zip
hostap-8788a314d7897c90195c6f94810f55b2ba6e7190.tar.gz
hostap-8788a314d7897c90195c6f94810f55b2ba6e7190.tar.bz2
WPS: Update MAC address on address changes
The WPS component keeps a copy of the network interface MAC address. When MAC address is changed the WPS copy was not updated so WPS M1 message contained the old address. Some devices check this field and fail connection attempts. Update the WPS MAC address on interface MAC address changes. Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sony.com>
-rw-r--r--wpa_supplicant/wpa_supplicant.c1
-rw-r--r--wpa_supplicant/wps_supplicant.c10
-rw-r--r--wpa_supplicant/wps_supplicant.h5
3 files changed, 16 insertions, 0 deletions
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index a15f637..709a33f 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -4371,6 +4371,7 @@ 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);
return 0;
}
diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
index 737c4e0..1dd69a2 100644
--- a/wpa_supplicant/wps_supplicant.c
+++ b/wpa_supplicant/wps_supplicant.c
@@ -2233,6 +2233,16 @@ void wpas_wps_update_config(struct wpa_supplicant *wpa_s)
}
+void wpas_wps_update_mac_addr(struct wpa_supplicant *wpa_s)
+{
+ struct wps_context *wps;
+
+ wps = wpa_s->wps;
+ if (wps)
+ os_memcpy(wps->dev.mac_addr, wpa_s->own_addr, ETH_ALEN);
+}
+
+
#ifdef CONFIG_WPS_NFC
#ifdef CONFIG_WPS_ER
diff --git a/wpa_supplicant/wps_supplicant.h b/wpa_supplicant/wps_supplicant.h
index 0fbc851..c55936c 100644
--- a/wpa_supplicant/wps_supplicant.h
+++ b/wpa_supplicant/wps_supplicant.h
@@ -62,6 +62,7 @@ struct wpabuf * wpas_wps_er_nfc_config_token(struct wpa_supplicant *wpa_s,
int ndef, const char *uuid);
int wpas_wps_terminate_pending(struct wpa_supplicant *wpa_s);
void wpas_wps_update_config(struct wpa_supplicant *wpa_s);
+void wpas_wps_update_mac_addr(struct wpa_supplicant *wpa_s);
struct wpabuf * wpas_wps_nfc_config_token(struct wpa_supplicant *wpa_s,
int ndef, const char *id_str);
struct wpabuf * wpas_wps_nfc_token(struct wpa_supplicant *wpa_s, int ndef);
@@ -154,6 +155,10 @@ wpas_wps_reenable_networks_pending(struct wpa_supplicant *wpa_s)
return 0;
}
+static inline void wpas_wps_update_mac_addr(struct wpa_supplicant *wpa_s)
+{
+}
+
#endif /* CONFIG_WPS */
#endif /* WPS_SUPPLICANT_H */