core: fix wrong device state change on failure in NMDeviceEthernet

Due to a bug, when dcb fails it would change the device state
to NM_DEVICE_STATE_UNKNOWN (zero), instead of NM_DEVICE_STATE_FAILED.

clang warns:

    make[4]: Entering directory `./NetworkManager/src'
      CC       nm-device-ethernet.lo
    devices/nm-device-ethernet.c:1237:30: error: implicit conversion from enumeration type 'enum NMActStageReturn' to different enumeration type 'NMDeviceState' [-Werror,-Wenum-conversion]
                                                             NM_ACT_STAGE_RETURN_FAILURE,
                                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    devices/nm-device-ethernet.c:1261:30: error: implicit conversion from enumeration type 'enum NMActStageReturn' to different enumeration type 'NMDeviceState' [-Werror,-Wenum-conversion]
                                                             NM_ACT_STAGE_RETURN_FAILURE,
                                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Thomas Haller 2014-07-26 21:46:34 +02:00
parent a2a36d8450
commit 657ea51008

View file

@ -1234,7 +1234,7 @@ dcb_state (NMDevice *device, gboolean timeout)
if (!dcb_enable (device)) {
dcb_carrier_cleanup (device);
nm_device_state_changed (device,
NM_ACT_STAGE_RETURN_FAILURE,
NM_DEVICE_STATE_FAILED,
NM_DEVICE_STATE_REASON_DCB_FCOE_FAILED);
}
}
@ -1258,7 +1258,7 @@ dcb_state (NMDevice *device, gboolean timeout)
if (!dcb_configure (device)) {
dcb_carrier_cleanup (device);
nm_device_state_changed (device,
NM_ACT_STAGE_RETURN_FAILURE,
NM_DEVICE_STATE_FAILED,
NM_DEVICE_STATE_REASON_DCB_FCOE_FAILED);
}
}