summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Cardace <acardace@redhat.com>2020-03-04 16:22:37 +0100
committerAntonio Cardace <acardace@redhat.com>2020-03-06 10:39:00 +0100
commit40ea0335d0ce2a4390abc41c9735a5b805773a28 (patch)
tree459edb928fefda25025f80aed71c9da0a89f8a1e
parentb868fee9cb7b09b1e5d1c269f0591cb036813d79 (diff)
downloadNetworkManager-40ea0335d0ce2a4390abc41c9735a5b805773a28.tar.gz
nmtui: only set 'mode' and enable 'miimon' when setting up a new connection
When creating a new connection before the user gets the chance to modify the bond options let's just initialize 'mode' and 'miimon' (with related 'updelay' and 'downdelay'). Initializing also 'arp_interval', 'arp_ip_target' and 'primary' doesn't make much sense as by default they're disabled or contain empty values.
-rw-r--r--clients/tui/nm-editor-utils.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/clients/tui/nm-editor-utils.c b/clients/tui/nm-editor-utils.c
index 83fd8d3b7d..4201936170 100644
--- a/clients/tui/nm-editor-utils.c
+++ b/clients/tui/nm-editor-utils.c
@@ -56,24 +56,19 @@ bond_connection_setup_func (NMConnection *connection,
NMSetting *s_hw)
{
NMSettingBond *s_bond = NM_SETTING_BOND (s_hw);
- const char *def, *cur;
+ guint i;
+ const char *value;
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_MIIMON,
+ NM_SETTING_BOND_OPTION_DOWNDELAY,
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 (!nm_streq0 (def, cur))
- nm_setting_bond_add_option (s_bond, options[i], def);
+ value = nm_setting_bond_get_option_default (s_bond, options[i]);
+ if (value)
+ nm_setting_bond_add_option (s_bond, options[i], value);
}
}