From 6b2aaba6dfaa70d87a55439206a14b6b1053d5e8 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Thu, 7 Mar 2019 21:31:47 +0100 Subject: [PATCH] libnm: Fix reporting of unknown device types nm_device_get_device_type would report the device type as it was send on DBus, while fetching the property would mean that only a known device types is reported. Make both results consistent by coercing in nm_device_get_device_type rather than when setting the property. (cherry picked from commit a6a185ba00c6218d9b1ace6e3bd6b57347198246) --- libnm/nm-device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libnm/nm-device.c b/libnm/nm-device.c index db73797dd2..5965cb3b8f 100644 --- a/libnm/nm-device.c +++ b/libnm/nm-device.c @@ -356,7 +356,7 @@ get_property (GObject *object, switch (prop_id) { case PROP_DEVICE_TYPE: - g_value_set_enum (value, coerce_type (nm_device_get_device_type (device))); + g_value_set_enum (value, nm_device_get_device_type (device)); break; case PROP_UDI: g_value_set_string (value, nm_device_get_udi (device)); @@ -937,7 +937,7 @@ nm_device_get_device_type (NMDevice *self) { g_return_val_if_fail (NM_IS_DEVICE (self), NM_DEVICE_TYPE_UNKNOWN); - return NM_DEVICE_GET_PRIVATE (self)->device_type; + return coerce_type (NM_DEVICE_GET_PRIVATE (self)->device_type); } /**