The WPS component keeps a copy of the network interface mac address. When mac address is changed the WPS copy is not updated so WPS M1 message will contain 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@xxxxxxxx> --- wpa_supplicant/wpa_supplicant.c | 1 + wpa_supplicant/wps_supplicant.c | 11 +++++++++++ wpa_supplicant/wps_supplicant.h | 1 + 3 files changed, 13 insertions(+) diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index 21ef6fad1..1ff5809e5 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -4344,6 +4344,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 057927410..626eef0f8 100644 --- a/wpa_supplicant/wps_supplicant.c +++ b/wpa_supplicant/wps_supplicant.c @@ -2235,6 +2235,17 @@ 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 == NULL) + return; + 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 0fbc85174..f8f1bdeed 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); -- 2.17.1 _______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap