summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-02-19 10:10:27 +0100
committerThomas Haller <thaller@redhat.com>2020-02-19 10:39:55 +0100
commitd9d51dd42d288501bb1af5ef69736dd8f1687e3b (patch)
treec308a1bdeecb242405f29e31aba2f278f6743b04
parentefc04b1285674ba2aea459039f4143b3307b4bcf (diff)
downloadNetworkManager-d9d51dd42d288501bb1af5ef69736dd8f1687e3b.tar.gz
device: allow setting "arp_validate" with supported bond modes
arp_validate is allowed for several bonding modes, at least since commit [1]. The validation was too strict. Just use set_bond_attr() directly, that already correctly encodes whether to set the value or not. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=13ac34a8866e31b31db6237c73aa558aff84d765
-rw-r--r--src/devices/nm-device-bond.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/devices/nm-device-bond.c b/src/devices/nm-device-bond.c
index 08a288601e..347d633248 100644
--- a/src/devices/nm-device-bond.c
+++ b/src/devices/nm-device-bond.c
@@ -214,7 +214,7 @@ apply_bonding_config (NMDeviceBond *self)
*
* arp_interval conflicts miimon > 0
* arp_interval conflicts [ alb, tlb ]
- * arp_validate needs [ active-backup ]
+ * arp_validate does not work with [ BOND_MODE_8023AD, BOND_MODE_TLB, BOND_MODE_ALB ]
* downdelay needs miimon
* updelay needs miimon
* primary needs [ active-backup, tlb, alb ]
@@ -266,15 +266,8 @@ apply_bonding_config (NMDeviceBond *self)
*/
}
- /* ARP validate: value > 0 only valid in active-backup mode */
value = nm_setting_bond_get_option_by_name (s_bond, NM_SETTING_BOND_OPTION_ARP_VALIDATE);
- if ( value
- && !nm_streq (value, "0")
- && !nm_streq (value, "none")
- && mode == NM_BOND_MODE_ACTIVEBACKUP)
- set_bond_attr (device, mode, NM_SETTING_BOND_OPTION_ARP_VALIDATE, value);
- else
- set_bond_attr (device, mode, NM_SETTING_BOND_OPTION_ARP_VALIDATE, "0");
+ set_bond_attr (device, mode, NM_SETTING_BOND_OPTION_ARP_VALIDATE, value ?: "0");
/* Primary */
value = nm_setting_bond_get_option_by_name (s_bond, NM_SETTING_BOND_OPTION_PRIMARY);