mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-04 05:10:17 +01:00
nm-setting-bond: let 'miimon' and 'arp_interval' coexist for verify()
Fix 'miimon' and 'arp_interval' validation, they can both be set indeed, the kernel does not impose this limitation, nevertheless is sensible to keep the defaults as previously (miimon=100, arp_interval=0). Also add unit test.
This commit is contained in:
parent
c07f3b518c
commit
57bdf68088
2 changed files with 10 additions and 11 deletions
|
|
@ -661,17 +661,6 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||
num_grat_arp = _atoi (bond_get_option_or_default (self, NM_SETTING_BOND_OPTION_NUM_GRAT_ARP));
|
||||
num_unsol_na = _atoi (bond_get_option_or_default (self, NM_SETTING_BOND_OPTION_NUM_UNSOL_NA));
|
||||
|
||||
/* Can only set one of miimon and arp_interval */
|
||||
if (miimon > 0 && arp_interval > 0) {
|
||||
g_set_error (error,
|
||||
NM_CONNECTION_ERROR,
|
||||
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
||||
_("only one of '%s' and '%s' can be set"),
|
||||
NM_SETTING_BOND_OPTION_MIIMON,
|
||||
NM_SETTING_BOND_OPTION_ARP_INTERVAL);
|
||||
g_prefix_error (error, "%s.%s: ", NM_SETTING_BOND_SETTING_NAME, NM_SETTING_BOND_OPTIONS);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Verify bond mode */
|
||||
mode_orig = g_hash_table_lookup (priv->options, NM_SETTING_BOND_OPTION_MODE);
|
||||
|
|
|
|||
|
|
@ -595,6 +595,16 @@ test_bond_verify (void)
|
|||
"mode", "0",
|
||||
"downdelay", "0",
|
||||
"updelay", "0");
|
||||
test_verify_options (TRUE,
|
||||
"mode", "0",
|
||||
"miimon", "100",
|
||||
"arp_ip_target", "1.1.1.1",
|
||||
"arp_interval", "200");
|
||||
test_verify_options (TRUE,
|
||||
"mode", "0",
|
||||
"downdelay", "100",
|
||||
"arp_ip_target", "1.1.1.1",
|
||||
"arp_interval", "200");
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue