summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-08-22 09:59:53 +0200
committerThomas Haller <thaller@redhat.com>2019-08-28 16:27:00 +0200
commit34895adcc450fca238818db668b28981c0590d43 (patch)
treecf0c2bb043db8141cc448c83c2743d3007e5da50
parente034cc326470df3b2f192254195bbb753eadd4ac (diff)
downloadNetworkManager-34895adcc450fca238818db668b28981c0590d43.tar.gz
device: set failure reason when settings hardware address fails
-rw-r--r--src/devices/nm-device-tun.c6
-rw-r--r--src/devices/wifi/nm-device-wifi.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/src/devices/nm-device-tun.c b/src/devices/nm-device-tun.c
index 6d2a03036a..6087ff65e6 100644
--- a/src/devices/nm-device-tun.c
+++ b/src/devices/nm-device-tun.c
@@ -355,8 +355,12 @@ act_stage1_prepare (NMDevice *device, NMDeviceStateReason *out_failure_reason)
if (priv->props.type == IFF_TUN) {
/* Nothing to do for TUN devices */
} else {
- if (!nm_device_hw_addr_set_cloned (device, nm_device_get_applied_connection (device), FALSE))
+ if (!nm_device_hw_addr_set_cloned (device,
+ nm_device_get_applied_connection (device),
+ FALSE)) {
+ *out_failure_reason = NM_DEVICE_STATE_REASON_CONFIG_FAILED;
return NM_ACT_STAGE_RETURN_FAILURE;
+ }
}
return NM_ACT_STAGE_RETURN_SUCCESS;
diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c
index 901cb0a542..d9394ffdd5 100644
--- a/src/devices/wifi/nm-device-wifi.c
+++ b/src/devices/wifi/nm-device-wifi.c
@@ -2658,8 +2658,10 @@ act_stage1_prepare (NMDevice *device, NMDeviceStateReason *out_failure_reason)
priv->hw_addr_scan_expire = 0;
/* Set spoof MAC to the interface */
- if (!nm_device_hw_addr_set_cloned (device, connection, TRUE))
+ if (!nm_device_hw_addr_set_cloned (device, connection, TRUE)) {
+ *out_failure_reason = NM_DEVICE_STATE_REASON_CONFIG_FAILED;
return NM_ACT_STAGE_RETURN_FAILURE;
+ }
/* AP and Mesh modes never use a specific object or existing scanned AP */
if (!NM_IN_SET (priv->mode, NM_802_11_MODE_AP,