Blame SOURCES/1002-device-allow-setting-arp_validate-with-supported-bon-rh1789437.patch

613f66
From 517099b8bf6ee6ef801ef7ca9a3d32e80935b71a Mon Sep 17 00:00:00 2001
613f66
From: Thomas Haller <thaller@redhat.com>
613f66
Date: Wed, 19 Feb 2020 10:10:27 +0100
613f66
Subject: [PATCH 1/1] device: allow setting "arp_validate" with supported bond
613f66
 modes
613f66
613f66
arp_validate is allowed for several bonding modes, at least since commit [1].
613f66
613f66
The validation was too strict. Just use set_bond_attr() directly, that
613f66
already correctly encodes whether to set the value or not.
613f66
613f66
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=13ac34a8866e31b31db6237c73aa558aff84d765
613f66
613f66
(cherry picked from commit d9d51dd42d288501bb1af5ef69736dd8f1687e3b)
613f66
(cherry picked from commit 02ba767496302f516492357a3bd4dc6cee3bd343)
613f66
---
613f66
 src/devices/nm-device-bond.c | 11 ++---------
613f66
 1 file changed, 2 insertions(+), 9 deletions(-)
613f66
613f66
diff --git a/src/devices/nm-device-bond.c b/src/devices/nm-device-bond.c
613f66
index c6ecb2e85fb8..36d003283977 100644
613f66
--- a/src/devices/nm-device-bond.c
613f66
+++ b/src/devices/nm-device-bond.c
613f66
@@ -214,7 +214,7 @@ apply_bonding_config (NMDeviceBond *self)
613f66
 	 *
613f66
 	 * arp_interval conflicts miimon > 0
613f66
 	 * arp_interval conflicts [ alb, tlb ]
613f66
-	 * arp_validate needs [ active-backup ]
613f66
+	 * arp_validate does not work with [ BOND_MODE_8023AD, BOND_MODE_TLB, BOND_MODE_ALB ]
613f66
 	 * downdelay needs miimon
613f66
 	 * updelay needs miimon
613f66
 	 * primary needs [ active-backup, tlb, alb ]
613f66
@@ -266,15 +266,8 @@ apply_bonding_config (NMDeviceBond *self)
613f66
 		 */
613f66
 	}
613f66
 
613f66
-	/* ARP validate: value > 0 only valid in active-backup mode */
613f66
 	value = nm_setting_bond_get_option_by_name (s_bond, NM_SETTING_BOND_OPTION_ARP_VALIDATE);
613f66
-	if (   value
613f66
-	    && !nm_streq (value, "0")
613f66
-	    && !nm_streq (value, "none")
613f66
-	    && mode == NM_BOND_MODE_ACTIVEBACKUP)
613f66
-		set_bond_attr (device, mode, NM_SETTING_BOND_OPTION_ARP_VALIDATE, value);
613f66
-	else
613f66
-		set_bond_attr (device, mode, NM_SETTING_BOND_OPTION_ARP_VALIDATE, "0");
613f66
+	set_bond_attr (device, mode, NM_SETTING_BOND_OPTION_ARP_VALIDATE, value ?: "0");
613f66
 
613f66
 	/* Primary */
613f66
 	value = nm_setting_bond_get_option_by_name (s_bond, NM_SETTING_BOND_OPTION_PRIMARY);
613f66
-- 
613f66
2.24.1
613f66