diff --git a/libnm-core/nm-connection.c b/libnm-core/nm-connection.c index 5f406cc64a..a19a09dcd8 100644 --- a/libnm-core/nm-connection.c +++ b/libnm-core/nm-connection.c @@ -169,11 +169,15 @@ nm_connection_remove_setting (NMConnection *connection, GType setting_type) static gpointer _connection_get_setting (NMConnection *connection, GType setting_type) { + NMSetting *setting; + nm_assert (NM_IS_CONNECTION (connection)); nm_assert (g_type_is_a (setting_type, NM_TYPE_SETTING)); - return g_hash_table_lookup (NM_CONNECTION_GET_PRIVATE (connection)->settings, - g_type_name (setting_type)); + setting = g_hash_table_lookup (NM_CONNECTION_GET_PRIVATE (connection)->settings, + g_type_name (setting_type)); + nm_assert (!setting || G_TYPE_CHECK_INSTANCE_TYPE (setting, setting_type)); + return setting; } static gpointer diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 1a7b90cb57..645e8dff8a 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -2418,7 +2418,7 @@ nm_device_has_unmodified_applied_connection (NMDevice *self, NMSettingCompareFla return nm_active_connection_has_unmodified_applied_connection ((NMActiveConnection *) priv->act_request.obj, compare_flags); } -NMSetting * +gpointer nm_device_get_applied_setting (NMDevice *self, GType setting_type) { NMConnection *connection; diff --git a/src/devices/nm-device.h b/src/devices/nm-device.h index bf867f4852..353bf63347 100644 --- a/src/devices/nm-device.h +++ b/src/devices/nm-device.h @@ -543,7 +543,9 @@ NMConnection * nm_device_get_settings_connection_get_connection (NMDevice *self NMConnection * nm_device_get_applied_connection (NMDevice *dev); gboolean nm_device_has_unmodified_applied_connection (NMDevice *self, NMSettingCompareFlags compare_flags); -NMSetting * nm_device_get_applied_setting (NMDevice *dev, GType setting_type); + +gpointer /* (NMSetting *) */ nm_device_get_applied_setting (NMDevice *dev, + GType setting_type); void nm_device_removed (NMDevice *self, gboolean unconfigure_ip_config);