From 45bef0ad173fc0784e4d1ea013378d1254c46fd0 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Tue, 11 Apr 2017 16:32:05 +0200 Subject: [PATCH] cli: fix evaluation of supported settings for *-slave connections To determine the valid settings we must consider the actual connection type, not the user-supplied one because, for example, "bridge-slave" is in fact an ethernet connection. Fixes: fb8fe1d8cb452d203c8cf0941c2a82e5903a0c8a https://bugzilla.redhat.com/show_bug.cgi?id=1440957 --- clients/cli/connections.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/clients/cli/connections.c b/clients/cli/connections.c index 46b73257f4..2d611eefa9 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -6977,7 +6977,7 @@ menu_switch_to_level1 (NmCli *nmc, } static gboolean -editor_menu_main (NmCli *nmc, NMConnection *connection, const char *connection_type) +editor_menu_main (NmCli *nmc, NMConnection *connection) { NMSettingConnection *s_con; NMRemoteConnection *rem_con; @@ -7005,7 +7005,7 @@ editor_menu_main (NmCli *nmc, NMConnection *connection, const char *connection_t s_type = nm_setting_connection_get_slave_type (s_con); slv_type = g_strdup_printf ("%s-slave", s_type ? s_type : "no"); - valid_settings_main = get_valid_settings_array (connection_type); + valid_settings_main = get_valid_settings_array (nm_connection_get_connection_type (connection)); valid_settings_slave = get_valid_settings_array (slv_type); g_free (slv_type); @@ -8047,11 +8047,11 @@ do_connection_edit (NmCli *nmc, int argc, char **argv) /* Set global variables for use in TAB completion */ nmc_tab_completion.nmc = nmc; - nmc_tab_completion.con_type = g_strdup (connection_type); + nmc_tab_completion.con_type = g_strdup (nm_connection_get_connection_type (connection)); nmc_tab_completion.connection = connection; /* Run menu loop */ - editor_menu_main (nmc, connection, connection_type); + editor_menu_main (nmc, connection); if (connection) g_object_unref (connection);