diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 86d5dd862..ddf61551b 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -1189,6 +1189,7 @@ static void nl80211_refresh_mac(struct wpa_driver_nl80211_data *drv, MACSTR " to " MACSTR, ifindex, bss->ifname, MAC2STR(bss->addr), MAC2STR(addr)); + os_memcpy(bss->prev_addr, bss->addr, ETH_ALEN); os_memcpy(bss->addr, addr, ETH_ALEN); if (notify) wpa_supplicant_event(drv->ctx, @@ -10892,6 +10893,7 @@ static int nl80211_set_mac_addr(void *priv, const u8 *addr) wpa_printf(MSG_DEBUG, "nl80211: set_mac_addr for %s to " MACSTR, bss->ifname, MAC2STR(addr)); drv->addr_changed = new_addr; + os_memcpy(bss->prev_addr, bss->addr, ETH_ALEN); os_memcpy(bss->addr, addr, ETH_ALEN); if (linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 1) < 0) diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h index 0b8b0ce11..0740e064a 100644 --- a/src/drivers/driver_nl80211.h +++ b/src/drivers/driver_nl80211.h @@ -68,6 +68,7 @@ struct i802_bss { unsigned int use_nl_connect:1; u8 addr[ETH_ALEN]; + u8 prev_addr[ETH_ALEN]; int freq; int bandwidth; diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c index 619670980..c10c31a37 100644 --- a/src/drivers/driver_nl80211_event.c +++ b/src/drivers/driver_nl80211_event.c @@ -1240,8 +1240,11 @@ static void mlme_event_deauth_disassoc(struct wpa_driver_nl80211_data *drv, * ignore_next_local_deauth as well, to avoid next local * deauth event be wrongly ignored. */ - if (!os_memcmp(mgmt->sa, drv->first_bss->addr, - ETH_ALEN)) { + if (os_memcmp(mgmt->sa, drv->first_bss->addr, + ETH_ALEN) == 0 || + (!is_zero_ether_addr(drv->first_bss->prev_addr) && + os_memcmp(mgmt->sa, drv->first_bss->prev_addr, + ETH_ALEN) == 0)) { wpa_printf(MSG_DEBUG, "nl80211: Received a locally generated deauth event. Clear ignore_next_local_deauth flag"); drv->ignore_next_local_deauth = 0; @@ -1451,7 +1454,10 @@ static void mlme_event(struct i802_bss *bss, os_memcmp(bss->addr, data + 4, ETH_ALEN) != 0 && (is_zero_ether_addr(bss->rand_addr) || os_memcmp(bss->rand_addr, data + 4, ETH_ALEN) != 0) && - os_memcmp(bss->addr, data + 4 + ETH_ALEN, ETH_ALEN) != 0) { + os_memcmp(bss->addr, data + 4 + ETH_ALEN, ETH_ALEN) != 0 && + (is_zero_ether_addr(drv->first_bss->prev_addr) || + os_memcmp(bss->prev_addr, data + 4 + ETH_ALEN, + ETH_ALEN) != 0)) { wpa_printf(MSG_MSGDUMP, "nl80211: %s: Ignore MLME frame event " "for foreign address", bss->ifname); return;