mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-30 00:20:11 +01:00
device: always take device down when changing MAC for wifi devices
If the device is not taken down wpa_supplicant does not detect that
the MAC changed and the authentication can fail due to wrong key
derivation.
Fixes: e206a34732
https://bugzilla.redhat.com/show_bug.cgi?id=1656157
This commit is contained in:
parent
8c744b66cc
commit
29e8f6d5a1
1 changed files with 9 additions and 2 deletions
|
|
@ -15483,7 +15483,7 @@ _hw_addr_set (NMDevice *self,
|
|||
NMPlatformError plerr;
|
||||
guint8 addr_bytes[NM_UTILS_HWADDR_LEN_MAX];
|
||||
gsize addr_len;
|
||||
gboolean was_taken_down;
|
||||
gboolean was_taken_down = FALSE;
|
||||
gboolean retry_down;
|
||||
|
||||
nm_assert (NM_IS_DEVICE (self));
|
||||
|
|
@ -15507,7 +15507,14 @@ _hw_addr_set (NMDevice *self,
|
|||
|
||||
_LOGT (LOGD_DEVICE, "set-hw-addr: setting MAC address to '%s' (%s, %s)...", addr, operation, detail);
|
||||
|
||||
was_taken_down = FALSE;
|
||||
if (nm_device_get_device_type (self) == NM_DEVICE_TYPE_WIFI) {
|
||||
/* Always take the device down for Wi-Fi because
|
||||
* wpa_supplicant needs it to properly detect the MAC
|
||||
* change. */
|
||||
retry_down = FALSE;
|
||||
was_taken_down = TRUE;
|
||||
nm_device_take_down (self, FALSE);
|
||||
}
|
||||
|
||||
again:
|
||||
plerr = nm_platform_link_set_address (nm_device_get_platform (self), nm_device_get_ip_ifindex (self), addr_bytes, addr_len);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue