From 2bd8d2f0cf8536cc2a40d31ca161af09f472a0e1 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 28 Jun 2022 06:56:51 -0400 Subject: [PATCH] import nmstate-1.2.1-3.el8_6 --- ...ot-validate-on-non-desired-interface.patch | 78 +++++++++++++++++++ ...-clear-vlan-filtering-when-set-empty.patch | 60 ++++++++++++++ ...m-bridge-Fix-multicast_router-option.patch | 72 +++++++++++++++++ SPECS/nmstate.spec | 12 ++- 4 files changed, 221 insertions(+), 1 deletion(-) create mode 100644 SOURCES/BZ_2080528-ovs-Do-not-validate-on-non-desired-interface.patch create mode 100644 SOURCES/BZ_2080530-python-bridge-clear-vlan-filtering-when-set-empty.patch create mode 100644 SOURCES/BZ_2088373-nm-bridge-Fix-multicast_router-option.patch diff --git a/SOURCES/BZ_2080528-ovs-Do-not-validate-on-non-desired-interface.patch b/SOURCES/BZ_2080528-ovs-Do-not-validate-on-non-desired-interface.patch new file mode 100644 index 0000000..52046a7 --- /dev/null +++ b/SOURCES/BZ_2080528-ovs-Do-not-validate-on-non-desired-interface.patch @@ -0,0 +1,78 @@ +From c2aa72122d811180ae8c8f7f4fcb19a251024528 Mon Sep 17 00:00:00 2001 +From: Gris Ge +Date: Fri, 29 Apr 2022 14:25:53 +0800 +Subject: [PATCH] ovs: Do not validate on non-desired interface + +Currently nmstate is showing unmanaged ovs vxlan with empty parent which +failure the apply() even it is not mentioned in desire state. + +The fix is skip all the validations on non-desired interfaces. + +Integration test case included. + +Signed-off-by: Gris Ge +--- + libnmstate/ifaces/ifaces.py | 14 ++++++++++---- + tests/integration/ovs_test.py | 26 ++++++++++++++++++++++++++ + 2 files changed, 36 insertions(+), 4 deletions(-) + +diff --git a/libnmstate/ifaces/ifaces.py b/libnmstate/ifaces/ifaces.py +index c2a5d3c4..c2f9bfa9 100644 +--- a/libnmstate/ifaces/ifaces.py ++++ b/libnmstate/ifaces/ifaces.py +@@ -159,7 +159,8 @@ class Ifaces: + self._apply_copy_mac_from() + self.gen_metadata() + for iface in self.all_ifaces(): +- iface.pre_edit_validation_and_cleanup() ++ if iface.is_desired and iface.is_up: ++ iface.pre_edit_validation_and_cleanup() + + self._pre_edit_validation_and_cleanup() + +@@ -293,7 +294,11 @@ class Ifaces: + When OVS patch peer does not exist or is down, raise an error. + """ + for iface in self._kernel_ifaces.values(): +- if iface.type == InterfaceType.OVS_INTERFACE and iface.is_up: ++ if ( ++ iface.type == InterfaceType.OVS_INTERFACE ++ and iface.is_up ++ and iface.is_desired ++ ): + if iface.peer: + peer_iface = self._kernel_ifaces.get(iface.peer) + if not peer_iface or not peer_iface.is_up: +@@ -315,9 +320,9 @@ class Ifaces: + Validate that vlan is not being created over infiniband interface + """ + for iface in self._kernel_ifaces.values(): +- + if ( + iface.type in [InterfaceType.VLAN, InterfaceType.VXLAN] ++ and iface.is_desired + and iface.is_up + ): + if ( +@@ -338,9 +343,9 @@ class Ifaces: + If base MTU is not present, set same as vlan MTU + """ + for iface in self._kernel_ifaces.values(): +- + if ( + iface.type in [InterfaceType.VLAN, InterfaceType.VXLAN] ++ and iface.is_desired + and iface.is_up + and iface.mtu + ): +@@ -423,6 +428,7 @@ class Ifaces: + for ifname, iface in self._kernel_ifaces.items(): + if ( + iface.type == InterfaceType.VETH ++ and iface.is_desired + and iface.is_up + and not iface.peer + ): +-- +2.35.1 + diff --git a/SOURCES/BZ_2080530-python-bridge-clear-vlan-filtering-when-set-empty.patch b/SOURCES/BZ_2080530-python-bridge-clear-vlan-filtering-when-set-empty.patch new file mode 100644 index 0000000..3fdb240 --- /dev/null +++ b/SOURCES/BZ_2080530-python-bridge-clear-vlan-filtering-when-set-empty.patch @@ -0,0 +1,60 @@ +From bc677dc4f356a89a9af5cf45e80d31afff44c6d7 Mon Sep 17 00:00:00 2001 +From: Fernando Fernandez Mancera +Date: Fri, 25 Mar 2022 13:27:16 +0100 +Subject: [PATCH] python, bridge: clear vlan filtering when set empty + +When the user specifies 'vlan: {}', Nmstate should clear the vlan +configuration for that port instead of merging it. + +Signed-off-by: Fernando Fernandez Mancera +(cherry picked from commit 8b87c7d533dfb568f9a1715d7b2c59c415c9470a) +--- + libnmstate/ifaces/linux_bridge.py | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +diff --git a/libnmstate/ifaces/linux_bridge.py b/libnmstate/ifaces/linux_bridge.py +index ce331692..950e8c9e 100644 +--- a/libnmstate/ifaces/linux_bridge.py ++++ b/libnmstate/ifaces/linux_bridge.py +@@ -124,15 +124,38 @@ class LinuxBridgeIface(BridgeIface): + def gen_metadata(self, ifaces): + super().gen_metadata(ifaces) + if not self.is_absent: ++ original_ports_config = self.original_desire_dict.get( ++ LinuxBridge.CONFIG_SUBTREE, {} ++ ).get(LinuxBridge.PORT_SUBTREE, []) + for port_config in self.port_configs: + port_iface = ifaces.all_kernel_ifaces.get( + port_config[LinuxBridge.Port.NAME] + ) + if port_iface: ++ original_port = self._get_port_config( ++ original_ports_config, port_iface.name ++ ) ++ if ( ++ original_port ++ and original_port.get( ++ LinuxBridge.Port.VLAN_SUBTREE, None ++ ) ++ == {} ++ ): ++ port_config[ ++ LinuxBridge.Port.VLAN_SUBTREE ++ ] = original_port.get(LinuxBridge.Port.VLAN_SUBTREE) + port_iface.update( + {BridgeIface.BRPORT_OPTIONS_METADATA: port_config} + ) + ++ def _get_port_config(self, ports, port_name): ++ for port_config in ports: ++ if port_config[LinuxBridge.Port.NAME] == port_name: ++ return port_config ++ ++ return None ++ + def remove_port(self, port_name): + if self._bridge_config: + self.raw[LinuxBridge.CONFIG_SUBTREE][LinuxBridge.PORT_SUBTREE] = [ +-- +2.35.1 + diff --git a/SOURCES/BZ_2088373-nm-bridge-Fix-multicast_router-option.patch b/SOURCES/BZ_2088373-nm-bridge-Fix-multicast_router-option.patch new file mode 100644 index 0000000..aca4620 --- /dev/null +++ b/SOURCES/BZ_2088373-nm-bridge-Fix-multicast_router-option.patch @@ -0,0 +1,72 @@ +From 81d78014be4b985c8f86159d7abed6a9f73b128c Mon Sep 17 00:00:00 2001 +From: Gris Ge +Date: Thu, 28 Apr 2022 21:20:26 +0800 +Subject: [PATCH] nm bridge: Fix multicast_router option + +Adding the missing support of multicast_router option of linux bridge +with these values: + * 0: disabled + * 1: auto + * 2: enabled + +Integration test case included and marked as tier 1 as oVirt requested +this. + +Signed-off-by: Gris Ge +--- + libnmstate/nm/bridge.py | 20 ++++++++++++++++++++ + tests/integration/linux_bridge_test.py | 22 ++++++++++++++++++++++ + 2 files changed, 42 insertions(+) + +diff --git a/libnmstate/nm/bridge.py b/libnmstate/nm/bridge.py +index e7d28e2b..4241c926 100644 +--- a/libnmstate/nm/bridge.py ++++ b/libnmstate/nm/bridge.py +@@ -17,6 +17,7 @@ + # along with this program. If not, see . + # + ++from libnmstate.error import NmstateNotImplementedError + from libnmstate.schema import LinuxBridge as LB + + from .bridge_port_vlan import nmstate_port_vlan_to_nm +@@ -42,6 +43,12 @@ NM_BRIDGE_OPTIONS_MAP = { + OPT.MULTICAST_STARTUP_QUERY_INTERVAL: "multicast_startup_query_interval", + } + ++NM_BRIDGE_MCAST_ROUTER_VALUE_MAP = { ++ 0: "disabled", ++ 1: "auto", ++ 2: "enabled", ++} ++ + + def create_setting( + bridge_state, base_con_profile, original_desired_iface_state +@@ -80,6 +87,8 @@ def _set_bridge_properties(bridge_setting, options): + bridge_setting.props.multicast_snooping = val + elif key == LB.STP_SUBTREE: + _set_bridge_stp_properties(bridge_setting, val) ++ elif key == LB.Options.MULTICAST_ROUTER: ++ _set_bridge_mcast_router(bridge_setting, val) + elif key in NM_BRIDGE_OPTIONS_MAP: + nm_prop_name = NM_BRIDGE_OPTIONS_MAP[key] + # NM is using the sysfs name +@@ -138,3 +147,14 @@ def create_port_setting(options, base_con_profile): + + def get_port(nm_device): + return nm_device.get_slaves() ++ ++ ++def _set_bridge_mcast_router(bridge_setting, nmstate_value): ++ nm_value = NM_BRIDGE_MCAST_ROUTER_VALUE_MAP.get(nmstate_value) ++ if nm_value: ++ bridge_setting.props.multicast_router = nm_value ++ else: ++ raise NmstateNotImplementedError( ++ f"Unsupported value {nmstate_value} for " ++ "multicast_router bridge option" ++ ) +-- +2.35.3 + diff --git a/SPECS/nmstate.spec b/SPECS/nmstate.spec index a9d79d1..a271213 100644 --- a/SPECS/nmstate.spec +++ b/SPECS/nmstate.spec @@ -4,7 +4,7 @@ Name: nmstate Version: 1.2.1 -Release: 1%{?dist} +Release: 3%{?dist} Summary: Declarative network manager API License: LGPLv2+ URL: https://github.com/%{srcname}/%{srcname} @@ -12,6 +12,9 @@ Source0: %{url}/releases/download/v%{version}/%{srcname}-%{version}.tar.g Source1: %{url}/releases/download/v%{version}/%{srcname}-%{version}.tar.gz.asc Source2: https://www.nmstate.io/nmstate.gpg Source3: nmstate-rust-vendor-%{version}.tar.xz +Patch0: BZ_2080530-python-bridge-clear-vlan-filtering-when-set-empty.patch +Patch1: BZ_2080528-ovs-Do-not-validate-on-non-desired-interface.patch +Patch2: BZ_2088373-nm-bridge-Fix-multicast_router-option.patch BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: gnupg2 @@ -143,6 +146,13 @@ popd /sbin/ldconfig %changelog +* Tue May 24 2022 Fernando Fernandez Mancera - 1.2.1-3 +- Fix disable multicast-router for linux bridge. RHBZ#2088373 + +* Wed May 04 2022 Fernando Fernandez Mancera - 1.2.1-2 +- Fix ovs vxlan base-iface error. RHBZ#2080528 +- Fix clear linux bridge vlan filtering. RHBZ#2080530 + * Mon Feb 14 2022 Gris Ge - 1.2.1-1 - Upgrade to 1.2.1. RHBZ#1996618