diff options
author | Francesco Giudici <fgiudici@redhat.com> | 2016-06-24 15:44:58 +0200 |
---|---|---|
committer | Francesco Giudici <fgiudici@redhat.com> | 2016-06-27 10:52:14 +0200 |
commit | 89e2a45bbd3bb8da41cb20bdfde7320bfabcb650 (patch) | |
tree | 53066c4ed08a5242eeed0ed8728608ca4c445180 | |
parent | 8e07ea351d6d558a96e705d4380e82852b33861f (diff) | |
download | NetworkManager-fg/fix_add_vpn_type.tar.gz |
nmcli: when adding a vpn store the full service name in vpn-typefg/fix_add_vpn_type
When NM looks for vpn plugins, it would expect the full service name
otherwise it will not be able to retrieve the correct plugin.
Fixes VPN configurations generated with "nmcli connection add".
-rw-r--r-- | clients/cli/settings.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/clients/cli/settings.c b/clients/cli/settings.c index c8b72ef196..08a5d087e1 100644 --- a/clients/cli/settings.c +++ b/clients/cli/settings.c @@ -26,6 +26,7 @@ #include "utils.h" #include "common.h" +#include "nm-vpn-helpers.h" /* Forward declarations */ static char *wep_key_type_to_string (NMWepKeyType type); @@ -2959,6 +2960,16 @@ nmc_property_set_secret_flags (NMSetting *setting, const char *prop, const char } static gboolean +nmc_property_set_vpn_service (NMSetting *setting, const char *prop, const char *val, GError **error) +{ + gs_free char *service_name = NULL; + + service_name = nm_vpn_plugin_info_list_find_service_type (nm_vpn_get_plugin_infos (), val); + g_object_set (setting, prop, service_name ? : val, NULL); + return TRUE; +} + +static gboolean nmc_util_is_domain (const char *domain) { //FIXME: implement @@ -7081,7 +7092,7 @@ nmc_properties_init (void) /* Add editable properties for NM_SETTING_VPN_SETTING_NAME */ nmc_add_prop_funcs (GLUE (VPN, SERVICE_TYPE), nmc_property_vpn_get_service_type, - nmc_property_set_string, + nmc_property_set_vpn_service, NULL, NULL, NULL, |