device: set failure reason when settings hardware address fails

This commit is contained in:
Thomas Haller 2019-08-22 09:59:53 +02:00
parent e034cc3264
commit 34895adcc4
2 changed files with 8 additions and 2 deletions

View file

@ -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;

View file

@ -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,