From 42b0bef33c77a0921590b2697f077e8ea7805166 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Fri, 15 Jun 2018 15:33:39 +0200 Subject: [PATCH] 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 --- src/devices/nm-device-bond.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/devices/nm-device-bond.c b/src/devices/nm-device-bond.c index 22f7cdde3..f59ec9ff2 100644 --- a/src/devices/nm-device-bond.c +++ b/src/devices/nm-device-bond.c @@ -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; }