tui: allow configuring "primary" bond option with "balance-{alb,tlb}"

This commit is contained in:
Thomas Haller 2020-09-10 09:40:19 +02:00
parent cb3a73af92
commit b5041c14f4
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -255,13 +255,16 @@ mode_widget_changed (GObject *object,
_bond_add_option (priv->s_bond, NM_SETTING_BOND_OPTION_MODE, mode);
priv->updating = FALSE;
if (!strcmp (mode, "balance-tlb") || !strcmp (mode, "balance-alb")) {
if (NM_IN_STRSET (mode, "balance-tlb",
"balance-alb")) {
nmt_newt_popup_set_active (priv->monitoring, NMT_PAGE_BOND_MONITORING_MII);
nmt_newt_component_set_sensitive (NMT_NEWT_COMPONENT (priv->monitoring), FALSE);
} else
nmt_newt_component_set_sensitive (NMT_NEWT_COMPONENT (priv->monitoring), TRUE);
if (!strcmp (mode, "active-backup")) {
if (NM_IN_STRSET (mode, "active-backup",
"balance-alb",
"balance-tlb")) {
nmt_newt_widget_set_visible (NMT_NEWT_WIDGET (priv->primary), TRUE);
_bond_add_option (priv->s_bond, NM_SETTING_BOND_OPTION_PRIMARY,
nmt_newt_entry_get_text (priv->primary));