wifi: do not persist the mac address on AddAndActivate

If the client wants to pinpoint the connection to a particular device
they can just add an appropriate property.

That said, MAC address probably even doesn't count as appropriate; an
interface name is supposed to stay stable and could be used in such
cases.

This fixes the case where "nmcli d wifi connect ..." ends up with a
connection tied to a rather random device that happened to be around
even without the "ifname" argument.
This commit is contained in:
Lubomir Rintel
2018-11-19 18:33:45 +01:00
parent a31271d154
commit d64e577272

View File

@@ -909,18 +909,6 @@ complete_connection (NMDevice *device,
g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_MAC_ADDRESS); g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_MAC_ADDRESS);
return FALSE; return FALSE;
} }
} else {
guint8 tmp[ETH_ALEN];
/* Lock the connection to this device by default if it uses a
* permanent MAC address (ie not a 'locally administered' one)
*/
nm_utils_hwaddr_aton (perm_hw_addr, tmp, ETH_ALEN);
if (!(tmp[0] & 0x02)) {
g_object_set (G_OBJECT (s_wifi),
NM_SETTING_WIRELESS_MAC_ADDRESS, perm_hw_addr,
NULL);
}
} }
} }