diff options
| author | Michael Biebl <biebl@debian.org> | 2015-12-24 00:24:58 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2015-12-24 00:24:58 +0100 |
| commit | 54f6333410ffd570e62717d9e77c5c987175e397 (patch) | |
| tree | d0698cc29d0f53c0b6d2c68d35ee2e9d72153948 /libnm-util/nm-connection.c | |
| parent | a6ece1a2aa19a6268335c87d4fdef20123dd04a5 (diff) | |
Imported Upstream version 1.0.10 upstream/1.0.10
Diffstat (limited to 'libnm-util/nm-connection.c')
| -rw-r--r-- | libnm-util/nm-connection.c | 35 |
1 files changed, 11 insertions, 24 deletions
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); } |