mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-21 11:10:46 +02:00
https://bugzilla.gnome.org/show_bug.cgi?id=704666 https://bugzilla.redhat.com/show_bug.cgi?id=1133544
This commit is contained in:
parent
d787f0391b
commit
93438dd092
1 changed files with 5 additions and 10 deletions
|
|
@ -440,15 +440,7 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||
NMSettingBondPrivate *priv = NM_SETTING_BOND_GET_PRIVATE (setting);
|
||||
GHashTableIter iter;
|
||||
const char *key, *value;
|
||||
const char *valid_modes[] = { "balance-rr",
|
||||
"active-backup",
|
||||
"balance-xor",
|
||||
"broadcast",
|
||||
"802.3ad",
|
||||
"balance-tlb",
|
||||
"balance-alb",
|
||||
NULL };
|
||||
int miimon = 0, arp_interval = 0;
|
||||
int mode, miimon = 0, arp_interval = 0;
|
||||
const char *arp_ip_target = NULL;
|
||||
const char *lacp_rate;
|
||||
const char *primary;
|
||||
|
|
@ -484,6 +476,7 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||
g_prefix_error (error, "%s.%s: ", NM_SETTING_BOND_SETTING_NAME, NM_SETTING_BOND_OPTIONS);
|
||||
}
|
||||
|
||||
/* Verify bond mode */
|
||||
value = g_hash_table_lookup (priv->options, NM_SETTING_BOND_OPTION_MODE);
|
||||
if (!value) {
|
||||
g_set_error (error,
|
||||
|
|
@ -494,7 +487,8 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||
g_prefix_error (error, "%s.%s: ", NM_SETTING_BOND_SETTING_NAME, NM_SETTING_BOND_OPTIONS);
|
||||
return FALSE;
|
||||
}
|
||||
if (!_nm_utils_string_in_list (value, valid_modes)) {
|
||||
mode = nm_utils_bond_mode_string_to_int (value);
|
||||
if (mode == -1) {
|
||||
g_set_error (error,
|
||||
NM_CONNECTION_ERROR,
|
||||
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
||||
|
|
@ -503,6 +497,7 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||
g_prefix_error (error, "%s.%s: ", NM_SETTING_BOND_SETTING_NAME, NM_SETTING_BOND_OPTIONS);
|
||||
return FALSE;
|
||||
}
|
||||
value = nm_utils_bond_mode_int_to_string (mode);
|
||||
|
||||
/* Make sure mode is compatible with other settings */
|
||||
if ( strcmp (value, "balance-alb") == 0
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue