From 0044033b34591b30904f10e9fecd1022e241a1c0 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Dec 15 2020 16:05:54 +0000 Subject: import nmstate-0.3.4-15.el8_3 --- diff --git a/SOURCES/BZ_1890497-nm-bond-Ignore-ad_actor_system-00-00-00-00-00-00.patch b/SOURCES/BZ_1890497-nm-bond-Ignore-ad_actor_system-00-00-00-00-00-00.patch new file mode 100644 index 0000000..986aab9 --- /dev/null +++ b/SOURCES/BZ_1890497-nm-bond-Ignore-ad_actor_system-00-00-00-00-00-00.patch @@ -0,0 +1,49 @@ +From 8a7f1758da4cba81d65ba4b9b06bbf4b750a6f87 Mon Sep 17 00:00:00 2001 +From: Gris Ge +Date: Thu, 22 Oct 2020 14:09:27 +0800 +Subject: [PATCH 1/2] nm bond: Ignore ad_actor_system=00:00:00:00:00:00 + +The ad_actor_system=00:00:00:00:00:00 is invalid in kernel as that's the +default value of ad_actor_system. + +NM plugin should not set that value. + +Test case included. + +Signed-off-by: Gris Ge +Signed-off-by: Fernando Fernandez Mancera +--- + libnmstate/nm/bond.py | 9 +++++++++ + tests/integration/nm/bond_test.py | 12 ++++++++++++ + 2 files changed, 21 insertions(+) + +diff --git a/libnmstate/nm/bond.py b/libnmstate/nm/bond.py +index 9ea3648..d196965 100644 +--- a/libnmstate/nm/bond.py ++++ b/libnmstate/nm/bond.py +@@ -38,6 +38,8 @@ NM_SUPPORTED_BOND_OPTIONS = NM.SettingBond.get_valid_options( + + SYSFS_BOND_OPTION_FOLDER_FMT = "/sys/class/net/{ifname}/bonding" + ++BOND_AD_ACTOR_SYSTEM_USE_BOND_MAC = "00:00:00:00:00:00" ++ + + def create_setting(options, wired_setting): + bond_setting = NM.SettingBond.new() +@@ -48,6 +50,13 @@ def create_setting(options, wired_setting): + ): + # When in MAC restricted mode, MAC address should be unset. + wired_setting.props.cloned_mac_address = None ++ if ( ++ option_name == "ad_actor_system" ++ and option_value == BOND_AD_ACTOR_SYSTEM_USE_BOND_MAC ++ ): ++ # The all zero ad_actor_system is the kernel default value ++ # And it is invalid to set as all zero ++ continue + if option_value != SYSFS_EMPTY_VALUE: + success = bond_setting.add_option(option_name, str(option_value)) + if not success: +-- +2.25.4 + diff --git a/SOURCES/BZ_1890497-nm.ipv6-call-clear_routing_rules-when-creating-the-s.patch b/SOURCES/BZ_1890497-nm.ipv6-call-clear_routing_rules-when-creating-the-s.patch new file mode 100644 index 0000000..5c6f4b5 --- /dev/null +++ b/SOURCES/BZ_1890497-nm.ipv6-call-clear_routing_rules-when-creating-the-s.patch @@ -0,0 +1,33 @@ +From 46104725c121def5d85f492afd91e618c1c7c240 Mon Sep 17 00:00:00 2001 +From: Fernando Fernandez Mancera +Date: Tue, 27 Oct 2020 12:23:18 +0100 +Subject: [PATCH 2/2] nm.ipv6: call clear_routing_rules() when creating the + setting + +In order to remove IPv6 routing rules Nmstate needs to call +clear_routing_rules() on the IPv6 setting as it is done on the IPv4 +setting. + +Added a testcase for this. + +Signed-off-by: Fernando Fernandez Mancera +--- + libnmstate/nm/ipv6.py | 1 + + tests/integration/route_test.py | 15 +++++++++++++++ + 2 files changed, 16 insertions(+) + +diff --git a/libnmstate/nm/ipv6.py b/libnmstate/nm/ipv6.py +index f252578..9777c89 100644 +--- a/libnmstate/nm/ipv6.py ++++ b/libnmstate/nm/ipv6.py +@@ -106,6 +106,7 @@ def create_setting(config, base_con_profile): + setting_ip.props.never_default = False + setting_ip.props.ignore_auto_dns = False + setting_ip.clear_routes() ++ setting_ip.clear_routing_rules() + setting_ip.props.gateway = None + setting_ip.props.route_table = Route.USE_DEFAULT_ROUTE_TABLE + setting_ip.props.route_metric = Route.USE_DEFAULT_METRIC +-- +2.25.4 + diff --git a/SOURCES/BZ_1901571_do_not_check_ovs_daemon_when_showing.patch b/SOURCES/BZ_1901571_do_not_check_ovs_daemon_when_showing.patch new file mode 100644 index 0000000..5a91b83 --- /dev/null +++ b/SOURCES/BZ_1901571_do_not_check_ovs_daemon_when_showing.patch @@ -0,0 +1,103 @@ +From 2595c75cb8488e855fc5d98bcc944c6c0ad96b54 Mon Sep 17 00:00:00 2001 +From: Quique Llorente +Date: Tue, 24 Nov 2020 12:52:35 +0100 +Subject: [PATCH 1/2] ovs: Ignore ovs-port always + +At containerize nmstate we cannot run "systemctl openvswitch status" so +even with a openvswitch running at host it will appear as non running +but the ovs information will arrive from NM dbus interface. This breaks +nmstatectl show since ovs-port is not part of nmstate and is not +included in the schema. This change just ignore ovs-port even if +openvswitch appear as not running. + +Signed-off-by: Quique Llorente +Signed-off-by: Gris Ge +--- + libnmstate/nm/plugin.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libnmstate/nm/plugin.py b/libnmstate/nm/plugin.py +index 4032359..6b6217d 100644 +--- a/libnmstate/nm/plugin.py ++++ b/libnmstate/nm/plugin.py +@@ -123,6 +123,8 @@ class NetworkManagerPlugin(NmstatePlugin): + if nm_bond.is_bond_type_id(type_id): + bondinfo = nm_bond.get_bond_info(dev) + iface_info.update(_ifaceinfo_bond(bondinfo)) ++ elif nm_ovs.is_ovs_port_type_id(type_id): ++ continue + elif NmstatePlugin.OVS_CAPABILITY in capabilities: + if nm_ovs.is_ovs_bridge_type_id(type_id): + iface_info["bridge"] = nm_ovs.get_ovs_info( +@@ -133,8 +135,6 @@ class NetworkManagerPlugin(NmstatePlugin): + ) + elif nm_ovs.is_ovs_interface_type_id(type_id): + iface_info.update(nm_ovs.get_interface_info(act_con)) +- elif nm_ovs.is_ovs_port_type_id(type_id): +- continue + + info.append(iface_info) + +-- +2.29.2 + + +From 3202bdd08737087160ff96bcf921793ce6b8335c Mon Sep 17 00:00:00 2001 +From: Quique Llorente +Date: Wed, 25 Nov 2020 10:28:43 +0100 +Subject: [PATCH 2/2] ovs: Ignore OVS capabilities at get interfaces + +At containerize nmstate we cannot run "systemctl openvswitch status" so +even with a openvswitch running at host it will appear as non running +but the ovs information will arrive from NM dbus interface. This breaks +nmstatectl show since ovs-port is not part of nmstate and is not +included in the schema. This change removed the whole OVS compatibility check +when processing the interfaces reporting. + +Signed-off-by: Quique Llorente +Signed-off-by: Gris Ge +--- + libnmstate/nm/plugin.py | 18 +++++++----------- + 1 file changed, 7 insertions(+), 11 deletions(-) + +diff --git a/libnmstate/nm/plugin.py b/libnmstate/nm/plugin.py +index 6b6217d..06a5acd 100644 +--- a/libnmstate/nm/plugin.py ++++ b/libnmstate/nm/plugin.py +@@ -97,7 +97,6 @@ class NetworkManagerPlugin(NmstatePlugin): + + def get_interfaces(self): + info = [] +- capabilities = self.capabilities + + devices_info = [ + (dev, nm_device.get_device_common_info(dev)) +@@ -123,18 +122,15 @@ class NetworkManagerPlugin(NmstatePlugin): + if nm_bond.is_bond_type_id(type_id): + bondinfo = nm_bond.get_bond_info(dev) + iface_info.update(_ifaceinfo_bond(bondinfo)) ++ elif nm_ovs.is_ovs_bridge_type_id(type_id): ++ iface_info["bridge"] = nm_ovs.get_ovs_info( ++ self.context, dev, devices_info ++ ) ++ iface_info = _remove_ovs_bridge_unsupported_entries(iface_info) ++ elif nm_ovs.is_ovs_interface_type_id(type_id): ++ iface_info.update(nm_ovs.get_interface_info(act_con)) + elif nm_ovs.is_ovs_port_type_id(type_id): + continue +- elif NmstatePlugin.OVS_CAPABILITY in capabilities: +- if nm_ovs.is_ovs_bridge_type_id(type_id): +- iface_info["bridge"] = nm_ovs.get_ovs_info( +- self.context, dev, devices_info +- ) +- iface_info = _remove_ovs_bridge_unsupported_entries( +- iface_info +- ) +- elif nm_ovs.is_ovs_interface_type_id(type_id): +- iface_info.update(nm_ovs.get_interface_info(act_con)) + + info.append(iface_info) + +-- +2.29.2 + diff --git a/SPECS/nmstate.spec b/SPECS/nmstate.spec index 1f60f2d..5d89c6c 100644 --- a/SPECS/nmstate.spec +++ b/SPECS/nmstate.spec @@ -4,7 +4,7 @@ Name: nmstate Version: 0.3.4 -Release: 13%{?dist} +Release: 15%{?dist} Summary: Declarative network manager API License: LGPLv2+ URL: https://github.com/%{srcname}/%{srcname} @@ -20,6 +20,9 @@ Patch6: BZ_1859844-fix_converting_memory_only.patch Patch7: BZ_1866269-preserve_nm_uuid_in_ovsdb.patch Patch8: BZ_1869345_ovsdb_remove_all_ports.patch Patch9: BZ_1887349-Allow-duplicate-iface-name-in-ovs.patch +Patch10: BZ_1890497-nm-bond-Ignore-ad_actor_system-00-00-00-00-00-00.patch +Patch11: BZ_1890497-nm.ipv6-call-clear_routing_rules-when-creating-the-s.patch +Patch12: BZ_1901571_do_not_check_ovs_daemon_when_showing.patch BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3-setuptools @@ -90,6 +93,13 @@ gpgv2 --keyring ./gpgkey-mantainers.gpg %{SOURCE1} %{SOURCE0} %{python3_sitelib}/%{libname}/plugins/__pycache__/nmstate_plugin_ovsdb* %changelog +* Thu Nov 26 2020 Gris Ge - 0.3.4-15 +- Fix `libnmstate.show()` in container with OVS bridge. RHBZ#1901571 + +* Wed Nov 04 2020 Fernando Fernandez Mancera - 0.3.4-14 +- Ignore bond zero ad_actor_system. RHBZ#1890497 +- Fix clear IPv6 routing rules. + * Wed Oct 14 2020 Gris Ge - 0.3.4-13 - Allowing duplicate interface name of ovs. RHBZ#1887349