Blame SOURCES/BZ_1890497-nm-bond-Ignore-ad_actor_system-00-00-00-00-00-00.patch

004403
From 8a7f1758da4cba81d65ba4b9b06bbf4b750a6f87 Mon Sep 17 00:00:00 2001
004403
From: Gris Ge <fge@redhat.com>
004403
Date: Thu, 22 Oct 2020 14:09:27 +0800
004403
Subject: [PATCH 1/2] nm bond: Ignore ad_actor_system=00:00:00:00:00:00
004403
004403
The ad_actor_system=00:00:00:00:00:00 is invalid in kernel as that's the
004403
default value of ad_actor_system.
004403
004403
NM plugin should not set that value.
004403
004403
Test case included.
004403
004403
Signed-off-by: Gris Ge <fge@redhat.com>
004403
Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
004403
---
004403
 libnmstate/nm/bond.py             |  9 +++++++++
004403
 tests/integration/nm/bond_test.py | 12 ++++++++++++
004403
 2 files changed, 21 insertions(+)
004403
004403
diff --git a/libnmstate/nm/bond.py b/libnmstate/nm/bond.py
004403
index 9ea3648..d196965 100644
004403
--- a/libnmstate/nm/bond.py
004403
+++ b/libnmstate/nm/bond.py
004403
@@ -38,6 +38,8 @@ NM_SUPPORTED_BOND_OPTIONS = NM.SettingBond.get_valid_options(
004403
 
004403
 SYSFS_BOND_OPTION_FOLDER_FMT = "/sys/class/net/{ifname}/bonding"
004403
 
004403
+BOND_AD_ACTOR_SYSTEM_USE_BOND_MAC = "00:00:00:00:00:00"
004403
+
004403
 
004403
 def create_setting(options, wired_setting):
004403
     bond_setting = NM.SettingBond.new()
004403
@@ -48,6 +50,13 @@ def create_setting(options, wired_setting):
004403
         ):
004403
             # When in MAC restricted mode, MAC address should be unset.
004403
             wired_setting.props.cloned_mac_address = None
004403
+        if (
004403
+            option_name == "ad_actor_system"
004403
+            and option_value == BOND_AD_ACTOR_SYSTEM_USE_BOND_MAC
004403
+        ):
004403
+            # The all zero ad_actor_system is the kernel default value
004403
+            # And it is invalid to set as all zero
004403
+            continue
004403
         if option_value != SYSFS_EMPTY_VALUE:
004403
             success = bond_setting.add_option(option_name, str(option_value))
004403
             if not success:
004403
-- 
004403
2.25.4
004403