summary refs log tree commit diff
path: root/src/devices/nm-device-infiniband.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2016-08-26 02:18:32 +0200
committerMichael Biebl <biebl@debian.org>2016-08-26 02:18:32 +0200
commit7514efc2f38c9ace4557d4e69d68e7d380389030 (patch)
tree7fb00fda86cfcc2ca377f191633a7cfdbfea7ca3 /src/devices/nm-device-infiniband.c
parentd6201f5d8daada3d64a0a3e0038e14eebec683ce (diff)
Imported Upstream version 1.4.0 upstream/1.4.0
Diffstat (limited to 'src/devices/nm-device-infiniband.c')
-rw-r--r--src/devices/nm-device-infiniband.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/devices/nm-device-infiniband.c b/src/devices/nm-device-infiniband.c
index ae9543e4..17f50ba2 100644
--- a/src/devices/nm-device-infiniband.c
+++ b/src/devices/nm-device-infiniband.c
@@ -147,10 +147,15 @@ check_connection_compatible (NMDevice *device, NMConnection *connection)
 
 	if (nm_device_is_real (device)) {
 		const char *mac;
+		const char *hw_addr;
 
 		mac = nm_setting_infiniband_get_mac_address (s_infiniband);
-		if (mac && !nm_utils_hwaddr_matches (mac, -1, nm_device_get_hw_address (device), -1))
-			return FALSE;
+		if (mac) {
+			hw_addr = nm_device_get_permanent_hw_address (device, TRUE);
+			if (   !hw_addr
+			    || !nm_utils_hwaddr_matches (mac, -1, hw_addr, -1))
+				return FALSE;
+		}
 	}
 
 	return TRUE;
@@ -183,7 +188,7 @@ complete_connection (NMDevice *device,
 	}
 
 	setting_mac = nm_setting_infiniband_get_mac_address (s_infiniband);
-	hw_address = nm_device_get_hw_address (device);
+	hw_address = nm_device_get_permanent_hw_address (device, TRUE);
 	if (setting_mac) {
 		/* Make sure the setting MAC (if any) matches the device's MAC */
 		if (!nm_utils_hwaddr_matches (setting_mac, -1, hw_address, -1)) {
@@ -209,7 +214,7 @@ static void
 update_connection (NMDevice *device, NMConnection *connection)
 {
 	NMSettingInfiniband *s_infiniband = nm_connection_get_setting_infiniband (connection);
-	const char *mac = nm_device_get_hw_address (device);
+	const char *mac = nm_device_get_permanent_hw_address (device, TRUE);
 	const char *transport_mode = "datagram";
 	int ifindex;