mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 06:00:08 +01:00
wifi: only lock connection to device for non-locally-administered addresses
If the device's permanent MAC address is 'locally administered' (ie, first byte | 0x02 != 0) then we don't want to lock the connection to the device because it's likely a device that changes it's MAC every hotplug due to driver bugs or the fact that some devices don't store their MAC in EEPROM anyway.
This commit is contained in:
parent
e630b638a8
commit
2db6295b42
1 changed files with 5 additions and 2 deletions
|
|
@ -1211,8 +1211,11 @@ real_complete_connection (NMDevice *device,
|
|||
GByteArray *mac;
|
||||
const guint8 null_mac[ETH_ALEN] = { 0, 0, 0, 0, 0, 0 };
|
||||
|
||||
/* Lock the connection to this device by default */
|
||||
if (memcmp (priv->perm_hw_addr, null_mac, ETH_ALEN)) {
|
||||
/* Lock the connection to this device by default if it uses a
|
||||
* permanent MAC address (ie not a 'locally administered' one)
|
||||
*/
|
||||
if ( !(priv->perm_hw_addr[0] & 0x02)
|
||||
&& memcmp (priv->perm_hw_addr, null_mac, ETH_ALEN)) {
|
||||
mac = g_byte_array_sized_new (ETH_ALEN);
|
||||
g_byte_array_append (mac, priv->perm_hw_addr, ETH_ALEN);
|
||||
g_object_set (G_OBJECT (s_wifi), NM_SETTING_WIRELESS_MAC_ADDRESS, mac, NULL);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue