diff options
| author | Michael Biebl <biebl@debian.org> | 2016-08-26 02:18:32 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2016-08-26 02:18:32 +0200 |
| commit | 7514efc2f38c9ace4557d4e69d68e7d380389030 (patch) | |
| tree | 7fb00fda86cfcc2ca377f191633a7cfdbfea7ca3 /libnm/nm-device-ethernet.c | |
| parent | d6201f5d8daada3d64a0a3e0038e14eebec683ce (diff) | |
Imported Upstream version 1.4.0 upstream/1.4.0
Diffstat (limited to 'libnm/nm-device-ethernet.c')
| -rw-r--r-- | libnm/nm-device-ethernet.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libnm/nm-device-ethernet.c b/libnm/nm-device-ethernet.c index 88a7c432..825ed7b3 100644 --- a/libnm/nm-device-ethernet.c +++ b/libnm/nm-device-ethernet.c @@ -227,9 +227,14 @@ 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_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED, - _("Invalid device MAC address.")); + g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED, + _("Invalid device MAC address %s."), perm_addr); return FALSE; } if (try_mac && s_mac && !nm_utils_hwaddr_matches (s_mac, -1, perm_addr, -1)) { |