about summary refs log tree commit diff
path: root/src/devices/nm-device-vxlan.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/nm-device-vxlan.c')
-rw-r--r--src/devices/nm-device-vxlan.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/devices/nm-device-vxlan.c b/src/devices/nm-device-vxlan.c
index 45f33bdd..674c2a78 100644
--- a/src/devices/nm-device-vxlan.c
+++ b/src/devices/nm-device-vxlan.c
@@ -20,9 +20,10 @@
 
 #include "nm-default.h"
 
+#include "nm-device-vxlan.h"
+
 #include <string.h>
 
-#include "nm-device-vxlan.h"
 #include "nm-device-private.h"
 #include "nm-manager.h"
 #include "nm-platform.h"
@@ -30,7 +31,7 @@
 #include "nm-device-factory.h"
 #include "nm-setting-vxlan.h"
 #include "nm-setting-wired.h"
-#include "nm-connection-provider.h"
+#include "nm-settings.h"
 #include "nm-activation-request.h"
 #include "nm-ip4-config.h"
 
@@ -417,8 +418,8 @@ update_connection (NMDevice *device, NMConnection *connection)
 			NMConnection *parent_connection;
 
 			/* Don't change a parent specified by UUID if it's still valid */
-			parent_connection = nm_connection_provider_get_connection_by_uuid (nm_connection_provider_get (),
-			                                                                   setting_parent);
+			parent_connection = (NMConnection *) nm_settings_get_connection_by_uuid (nm_device_get_settings (device),
+			                                                                         setting_parent);
 			if (parent_connection && nm_device_check_connection_compatible (parent, parent_connection))
 				new_parent = NULL;
 		}
@@ -510,8 +511,6 @@ update_connection (NMDevice *device, NMConnection *connection)
 static NMActStageReturn
 act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason)
 {
-	NMSettingWired *s_wired;
-	const char *cloned_mac;
 	NMActStageReturn ret;
 
 	g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE);
@@ -520,12 +519,8 @@ act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason)
 	if (ret != NM_ACT_STAGE_RETURN_SUCCESS)
 		return ret;
 
-	s_wired = (NMSettingWired *) nm_device_get_applied_setting (device, NM_TYPE_SETTING_WIRED);
-	if (s_wired) {
-		/* Set device MAC address if the connection wants to change it */
-		cloned_mac = nm_setting_wired_get_cloned_mac_address (s_wired);
-		nm_device_set_hw_addr (device, cloned_mac, "set", LOGD_DEVICE);
-	}
+	if (!nm_device_hw_addr_set_cloned (device, nm_device_get_applied_connection (device), FALSE))
+		return NM_ACT_STAGE_RETURN_FAILURE;
 
 	return NM_ACT_STAGE_RETURN_SUCCESS;
 }