mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-07 04:00:30 +01:00
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 a6a185ba00)
This commit is contained in:
parent
2d547059dc
commit
6b2aaba6df
1 changed files with 2 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue