bond: fix setting num_grat_arp option

'num_grat_arp' and 'num_unsol_na' are actually the same attribute on
kernel side, so if only 'num_grat_arp' is set in configuration, we
first write its value and then overwrite it with the 'num_unsol_na'
default value (1). Instead, just write one of the two option.

https://bugzilla.redhat.com/show_bug.cgi?id=1591734
This commit is contained in:
Beniamino Galvani
2018-06-15 15:33:39 +02:00
parent 55598d8104
commit 42b0bef33c

View File

@@ -338,8 +338,6 @@ apply_bonding_config (NMDevice *device)
set_simple_option (device, mode, s_bond, NM_SETTING_BOND_OPTION_FAIL_OVER_MAC);
set_simple_option (device, mode, s_bond, NM_SETTING_BOND_OPTION_LACP_RATE);
set_simple_option (device, mode, s_bond, NM_SETTING_BOND_OPTION_LP_INTERVAL);
set_simple_option (device, mode, s_bond, NM_SETTING_BOND_OPTION_NUM_GRAT_ARP);
set_simple_option (device, mode, s_bond, NM_SETTING_BOND_OPTION_NUM_UNSOL_NA);
set_simple_option (device, mode, s_bond, NM_SETTING_BOND_OPTION_MIN_LINKS);
set_simple_option (device, mode, s_bond, NM_SETTING_BOND_OPTION_PACKETS_PER_SLAVE);
set_simple_option (device, mode, s_bond, NM_SETTING_BOND_OPTION_PRIMARY_RESELECT);
@@ -348,6 +346,16 @@ apply_bonding_config (NMDevice *device)
set_simple_option (device, mode, s_bond, NM_SETTING_BOND_OPTION_USE_CARRIER);
set_simple_option (device, mode, s_bond, NM_SETTING_BOND_OPTION_XMIT_HASH_POLICY);
/* num_grat_arp and num_unsol_na are actually the same attribute
* on kernel side and their value in the bond setting is guaranteed
* to be equal. Write only one of the two.
*/
value = nm_setting_bond_get_option_by_name (s_bond, NM_SETTING_BOND_OPTION_NUM_GRAT_ARP);
if (value)
set_bond_attr (device, mode, NM_SETTING_BOND_OPTION_NUM_GRAT_ARP, value);
else
set_simple_option (device, mode, s_bond, NM_SETTING_BOND_OPTION_NUM_UNSOL_NA);
return NM_ACT_STAGE_RETURN_SUCCESS;
}