diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2019-06-10 15:30:53 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2019-06-10 15:38:32 +0200 |
commit | dc71d9832dd36cbcc982daf30b284e60daf53a79 (patch) | |
tree | 1c045a073af6ead99c19b85115306a5513932754 /clients/tui/nm-editor-utils.c | |
parent | 512cbf690b2fdee851c559dc5da458f74891faa5 (diff) | |
download | NetworkManager-bg/bond-fixes.tar.gz |
tui: add only some options to new bond connectionsbg/bond-fixes
Instead of adding every known option to new bond connections, only add
the ones supported by UI.
https://bugzilla.redhat.com/show_bug.cgi?id=1715720
Diffstat (limited to 'clients/tui/nm-editor-utils.c')
-rw-r--r-- | clients/tui/nm-editor-utils.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/clients/tui/nm-editor-utils.c b/clients/tui/nm-editor-utils.c index 9dd95c0881..5bc30a6635 100644 --- a/clients/tui/nm-editor-utils.c +++ b/clients/tui/nm-editor-utils.c @@ -69,14 +69,23 @@ bond_connection_setup_func (NMConnection *connection, NMSetting *s_hw) { NMSettingBond *s_bond = NM_SETTING_BOND (s_hw); - const char **options, *def, *cur; - int i; - - options = nm_setting_bond_get_valid_options (s_bond); - for (i = 0; options[i]; i++) { + const char *def, *cur; + const char *const options[] = { + NM_SETTING_BOND_OPTION_MODE, + NM_SETTING_BOND_OPTION_MIIMON, + NM_SETTING_BOND_OPTION_ARP_INTERVAL, + NM_SETTING_BOND_OPTION_ARP_IP_TARGET, + NM_SETTING_BOND_OPTION_UPDELAY, + NM_SETTING_BOND_OPTION_DOWNDELAY, + NM_SETTING_BOND_OPTION_PRIMARY, + }; + guint i; + + /* Only add options supported by the UI */ + for (i = 0; i < G_N_ELEMENTS(options); i++) { def = nm_setting_bond_get_option_default (s_bond, options[i]); cur = nm_setting_bond_get_option_by_name (s_bond, options[i]); - if (g_strcmp0 (def, cur) != 0) + if (!nm_streq0 (def, cur)) nm_setting_bond_add_option (s_bond, options[i], def); } } |