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>
master
Mikael Kanstrup 5 years ago committed by Jouni Malinen
parent 39042d7f7c
commit 8788a314d7

@ -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;
}

@ -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

@ -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 */

Loading…
Cancel
Save