mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-22 10:20:35 +01:00
device: enable MAC address check on virtual devices
Virtual devices don't have a valid permanent hw address: when activating a connection against a specific interface, a check is performed on the device MAC address too: if it is an empty string, give a try to the currently assigned MAC address.
This commit is contained in:
parent
ddc35f27eb
commit
60a82e3ff2
1 changed files with 5 additions and 0 deletions
|
|
@ -227,6 +227,11 @@ connection_compatible (NMDevice *device, NMConnection *connection, GError **erro
|
|||
perm_addr = nm_device_ethernet_get_permanent_hw_address (NM_DEVICE_ETHERNET (device));
|
||||
s_mac = nm_setting_wired_get_mac_address (s_wired);
|
||||
if (perm_addr) {
|
||||
/* Virtual devices will have empty permanent addr but they should not be excluded
|
||||
* from the MAC address check specified in the connection */
|
||||
if (*perm_addr == 0)
|
||||
perm_addr = nm_device_ethernet_get_hw_address (NM_DEVICE_ETHERNET (device));
|
||||
|
||||
if (!nm_utils_hwaddr_valid (perm_addr, ETH_ALEN)) {
|
||||
g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED,
|
||||
_("Invalid device MAC address %s."), perm_addr);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue