summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiří Klimeš <jklimes@redhat.com>2015-02-10 15:33:35 +0100
committerJiří Klimeš <jklimes@redhat.com>2015-02-11 10:51:49 +0100
commit0ff9b75387b7ac2fd0235b23699990834426c467 (patch)
treed2f46ad3e05be0997ef015f542be5bf94dc04b11
parent6994454461100d45a7e2f063bd1f473652d4839d (diff)
downloadNetworkManager-0ff9b75387b7ac2fd0235b23699990834426c467.tar.gz
nmcli: allow adding 'generic' connections via nmcli connection add
'nmcli connection edit' already allows adding and editing generic connections (added by 2a2af5825a6db62e7a88bb249cf7876551ed7fa3).
-rw-r--r--clients/cli/connections.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/clients/cli/connections.c b/clients/cli/connections.c
index 3f7fc5cbca..610f53a9b7 100644
--- a/clients/cli/connections.c
+++ b/clients/cli/connections.c
@@ -3990,6 +3990,7 @@ complete_connection_by_type (NMConnection *connection,
GError **error)
{
NMSettingConnection *s_con;
+ NMSettingGeneric *s_generic;
NMSettingWired *s_wired;
NMSettingInfiniband *s_infiniband;
NMSettingWireless *s_wifi;
@@ -5216,6 +5217,10 @@ cleanup_olpc:
if (!success)
return FALSE;
+ } else if (!strcmp (con_type, NM_SETTING_GENERIC_SETTING_NAME)) {
+ /* Add 'generic' setting */
+ s_generic = (NMSettingGeneric *) nm_setting_generic_new ();
+ nm_connection_add_setting (connection, NM_SETTING (s_generic));
} else {
g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
_("Error: '%s' is not a valid connection type."),