Hide Forgot
+++ This bug was initially created as a clone of Bug #1374023 +++ for some drivers (brcmfmac), changing the MAC address doesn't take effect immediately. There is a race where changing the MAC address of a device can be missed by wpa_supplicant. As a result, the later association fails. See https://bugzilla.redhat.com/show_bug.cgi?id=1374023#c25 for details and logfile. See also upstream NetworkManager bug https://bugzilla.gnome.org/show_bug.cgi?id=770504#c12 With 1.4.0, NetworkManager would like to enable MAC address randomization by default. Thus the problem happens much more frequently.
NetworkManager now works around this issue. So, it's of lower priority. See https://bugzilla.redhat.com/show_bug.cgi?id=1374023#c30
As kernel only allows to change the MAC address when the device is !IFF_UP, one might reasonably require that reading the MAC address when a device is IFF_UP is sufficient and the one might assume that the MAC address does not change afterwards. So, that part seems like a driver issue, and wpa_supplicant might just require a fixed driver. On the other hand, it seems that wpa_supplicant could experience a race, where it would miss the fact that the MAC address went shortly down, and thus missing to re-read the MAC address...
see also https://bugzilla.gnome.org/show_bug.cgi?id=771005#c21 and https://bugzilla.gnome.org/show_bug.cgi?id=771005#c22.
Created attachment 1201607 [details] [patch] [dist-git] [rhel-7.3] I summarized the issue here: https://bugzilla.gnome.org/show_bug.cgi?id=771005#c37 The issue is primarily with 2.1 release. rhel-7.3's 2.0 does better. The reason why the issue doesn't usually happen is due to wpa_supplicant_update_mac_addr(), which hits: »···} else if (!(wpa_s->drv_flags & »···»··· WPA_DRIVER_FLAGS_P2P_DEDICATED_INTERFACE)) { »···»···l2_packet_deinit(wpa_s->l2); »···»···wpa_s->l2 = l2_packet_init(wpa_s->ifname, to reload the MAC address and finally setting wpa_sm_set_own_addr(). I think the attached patch is still the correct thing to do, but it's unclear when the situation is actually necessary.
with upcoming 2.6 rebase, this will be fixed automatically.
Tested against RHEL-7.4-20170525.7 and was unable to reproduce the failure to associate to an AP when the MAC address changes. Marking as verified.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:2053