From 54f6333410ffd570e62717d9e77c5c987175e397 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Thu, 24 Dec 2015 00:24:58 +0100 Subject: Imported Upstream version 1.0.10 --- libnm-util/nm-connection.c | 35 +++++++++++------------------------ libnm-util/nm-version.h | 6 ------ 2 files changed, 11 insertions(+), 30 deletions(-) (limited to 'libnm-util') diff --git a/libnm-util/nm-connection.c b/libnm-util/nm-connection.c index 3a929b04..e952835d 100644 --- a/libnm-util/nm-connection.c +++ b/libnm-util/nm-connection.c @@ -301,28 +301,6 @@ nm_connection_get_setting_by_name (NMConnection *connection, const char *name) return type ? nm_connection_get_setting (connection, type) : NULL; } -/* not exposed until we actually need it */ -static NMSetting * -_get_type_setting (NMConnection *connection) -{ - NMSettingConnection *s_con; - const char *type; - NMSetting *base; - - g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); - - s_con = nm_connection_get_setting_connection (connection); - g_assert (s_con); - - type = nm_setting_connection_get_connection_type (s_con); - g_assert (type); - - base = nm_connection_get_setting_by_name (connection, type); - g_assert (base); - - return base; -} - static gboolean validate_permissions_type (GHashTable *hash, GError **error) { @@ -1430,12 +1408,21 @@ nm_connection_get_interface_name (NMConnection *connection) const char * nm_connection_get_virtual_iface_name (NMConnection *connection) { + NMSettingConnection *s_con; + const char *type; NMSetting *base; g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); - base = _get_type_setting (connection); - g_assert (base); + s_con = nm_connection_get_setting_connection (connection); + g_return_val_if_fail (s_con, NULL); + + type = nm_setting_connection_get_connection_type (s_con); + g_return_val_if_fail (type, NULL); + + base = nm_connection_get_setting_by_name (connection, type); + if (!base) + return NULL; return nm_setting_get_virtual_iface_name (base); } diff --git a/libnm-util/nm-version.h b/libnm-util/nm-version.h index 68955099..63895dda 100644 --- a/libnm-util/nm-version.h +++ b/libnm-util/nm-version.h @@ -88,10 +88,4 @@ # define NM_AVAILABLE_IN_1_0_6 #endif -#if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_0_8 -# define NM_AVAILABLE_IN_1_0_8 G_UNAVAILABLE(1,0.8) -#else -# define NM_AVAILABLE_IN_1_0_8 -#endif - #endif /* NM_VERSION_H */ -- cgit 1.3.0-6-gf8a5