NetworkManager/rh1263185-nmcli-con-add-generic.patch

45 lines
1.5 KiB
Diff

From b46ed879198e911521373391c27982034699dfe5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= <jklimes@redhat.com>
Date: Tue, 10 Feb 2015 15:33:35 +0100
Subject: [PATCH] nmcli: allow adding 'generic' connections via nmcli
connection add
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
'nmcli connection edit' already allows adding and editing generic connections
(added by 2a2af5825a6db62e7a88bb249cf7876551ed7fa3).
(cherry picked from commit 0ff9b75387b7ac2fd0235b23699990834426c467)
Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
---
clients/cli/connections.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/clients/cli/connections.c b/clients/cli/connections.c
index 8d138bd..3c95c03 100644
--- a/clients/cli/connections.c
+++ b/clients/cli/connections.c
@@ -4006,6 +4006,7 @@ complete_connection_by_type (NMConnection *connection,
GError **error)
{
NMSettingConnection *s_con;
+ NMSettingGeneric *s_generic;
NMSettingWired *s_wired;
NMSettingInfiniband *s_infiniband;
NMSettingWireless *s_wifi;
@@ -5232,6 +5233,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."),
--
2.1.0