about summary refs log tree commit diff
path: root/libnm/nm-device-ethernet.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2016-08-26 02:19:30 +0200
committerMichael Biebl <biebl@debian.org>2016-08-26 02:19:30 +0200
commit229bfa11c4d56b4c1017c81c7dbafbedd15e3153 (patch)
treeedfc7357b6494a5c0cb016bb88d61b623daa9876 /libnm/nm-device-ethernet.c
parent6318db9c78b4fe207dfe700cfac11a675fc63dc9 (diff)
parent7514efc2f38c9ace4557d4e69d68e7d380389030 (diff)
Merge tag 'upstream/1.4.0'
Upstream version 1.4.0
Diffstat (limited to 'libnm/nm-device-ethernet.c')
-rw-r--r--libnm/nm-device-ethernet.c9
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)) {