diff options
| author | Sebastien Bacher <seb128@ubuntu.com> | 2019-08-09 11:09:27 +0200 |
|---|---|---|
| committer | Sebastien Bacher <seb128@ubuntu.com> | 2019-08-09 11:18:39 +0200 |
| commit | 820498b2158e0b05421ce0922f203a0699927fa8 (patch) | |
| tree | 3bf6d1089b762535ec5e59738d47ae2d2f54750f /clients/tui/nm-editor-utils.c | |
| parent | 1bd9f376796563dfb5016bada66c78b203f41d33 (diff) | |
| parent | 488dda3930545969f5644b57cfca81e21df031c3 (diff) | |
Merge remote-tracking branch 'salsa/master'
Diffstat (limited to 'clients/tui/nm-editor-utils.c')
| -rw-r--r-- | clients/tui/nm-editor-utils.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/clients/tui/nm-editor-utils.c b/clients/tui/nm-editor-utils.c index 9dd95c08..9698c1d7 100644 --- a/clients/tui/nm-editor-utils.c +++ b/clients/tui/nm-editor-utils.c @@ -1,4 +1,3 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -69,14 +68,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; + static const char *const options[] = { + NM_SETTING_BOND_OPTION_ARP_INTERVAL, + NM_SETTING_BOND_OPTION_ARP_IP_TARGET, + NM_SETTING_BOND_OPTION_DOWNDELAY, + NM_SETTING_BOND_OPTION_MIIMON, + NM_SETTING_BOND_OPTION_MODE, + NM_SETTING_BOND_OPTION_PRIMARY, + NM_SETTING_BOND_OPTION_UPDELAY, + }; + 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); } } |