From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 512761FF143 for ; Sat, 25 Apr 2026 23:38:00 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D48E93C9B; Sat, 25 Apr 2026 23:37:58 +0200 (CEST) X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1777153035; bh=CplXZ/+d+EqoIESYBX8MoNok9jKGF0s/zwsy8rXvQNQ=; h=Message-Id:Date:Cc:Subject:To:From; b=i9c1jt/blYQEC/waqmYcBbjqaV6ApFUlw+ynoQCScW0UYJN6w7PhX9HcUqcMLkZ+f 7LPPQz6jcQ2Fx76iN2OEoMMLtF+oapXfbDa0eIM47xCyMkoiB/T5VHhsN0Pw91hBYC SKlNlQgldBJFSWFHLapP4xBbMva+tyiWOLeQ3dg0= Authentication-Results: mail-nwsmtp-smtp-production-main-67.sas.yp-c.yandex.net; dkim=pass header.i=@yandex.ru From: Pavel Afonin To: pve-devel@lists.proxmox.com Subject: [PATCH ifupdown2] d/patches: preserve OVS options on reload Date: Sun, 26 Apr 2026 00:36:48 +0300 Message-Id: <20260425213648.112422-1-afonin.pb@yandex.ru> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy FREEMAIL_FROM 0.001 Sender email is commonly abused enduser mail provider RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: PJGTOXIL7GGD2PMJVCDNWQCI66Q7TTMO X-Message-ID-Hash: PJGTOXIL7GGD2PMJVCDNWQCI66Q7TTMO X-MailFrom: afonin.pb@yandex.ru X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: When reloading an existing OVS bridge, the openvswitch addon currently adds the bridge and applies configured OVS options before clearing stale bridge and interface state. This can generate a command sequence where configured values such as other_config entries are set first and then immediately removed again by the following clear bridge command. As a result, OVS options configured in /etc/network/interfaces disappear after ifreload. Add a downstream patch that moves bridge creation and OVS option application after the cleanup block, so stale state is cleared first and the desired configuration is applied afterwards. Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=7030 Link: https://github.com/CumulusNetworks/ifupdown2/issues/344 Link: https://github.com/CumulusNetworks/ifupdown2/pull/345 Signed-off-by: Pavel Afonin --- ...witch-preserve-ovs-options-on-reload.patch | 69 +++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 70 insertions(+) create mode 100644 debian/patches/pve/0016-openvswitch-preserve-ovs-options-on-reload.patch diff --git a/debian/patches/pve/0016-openvswitch-preserve-ovs-options-on-reload.patch b/debian/patches/pve/0016-openvswitch-preserve-ovs-options-on-reload.patch new file mode 100644 index 0000000..be7b9ff --- /dev/null +++ b/debian/patches/pve/0016-openvswitch-preserve-ovs-options-on-reload.patch @@ -0,0 +1,69 @@ +From 221cce42f29e5578a5d074f718942636d5917e97 Mon Sep 17 00:00:00 2001 +From: Pavel Afonin +Date: Sat, 25 Apr 2026 23:29:27 +0300 +Subject: [PATCH] openvswitch: preserve OVS options on reload + +When reloading an existing OVS bridge, the openvswitch addon currently +adds the bridge and applies configured OVS options before clearing stale +bridge and interface state. + +This can generate a command sequence where configured values such as +other_config entries are set first and then immediately removed again by +the following clear bridge command. As a result, OVS options configured +in /etc/network/interfaces disappear after ifreload. + +Move bridge creation and OVS option application after the cleanup block, +so stale state is cleared first and the desired configuration is applied +afterwards. Initial bridge creation is unchanged, because the cleanup +block only runs for existing links. + +Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=7030 +Link: https://github.com/CumulusNetworks/ifupdown2/issues/344 +Link: https://github.com/CumulusNetworks/ifupdown2/pull/345 + +Signed-off-by: Pavel Afonin +--- + ifupdown2/addons/openvswitch.py | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +diff --git a/ifupdown2/addons/openvswitch.py b/ifupdown2/addons/openvswitch.py +index 0a124ba..352633a 100644 +--- a/ifupdown2/addons/openvswitch.py ++++ b/ifupdown2/addons/openvswitch.py +@@ -155,16 +155,6 @@ class openvswitch(Addon, moduleBase): + + cmd_list = [] + +- cmd = "--may-exist add-br %s"%(iface) +- if ovsparent is not None and ovsoptions: +- cmd = cmd + " %s" %(ovsoptions) +- +- cmd_list.append(cmd) +- +- if ovsparent is None and ovsoptions: +- cmd = "set bridge %s %s" %(iface, ovsoptions) +- cmd_list.append(cmd) +- + #update + if self.cache.link_exists (iface): + # on update, delete active ports not in the new port list +@@ -192,6 +182,16 @@ class openvswitch(Addon, moduleBase): + cmd = "--if-exists clear interface %s mtu_request external-ids other_config options"%(iface) + cmd_list.append(cmd) + ++ cmd = "--may-exist add-br %s"%(iface) ++ if ovsparent is not None and ovsoptions: ++ cmd = cmd + " %s" %(ovsoptions) ++ ++ cmd_list.append(cmd) ++ ++ if ovsparent is None and ovsoptions: ++ cmd = "set bridge %s %s" %(iface, ovsoptions) ++ cmd_list.append(cmd) ++ + if ovsextra is not None: + cmd_list.extend(ovsextra) + +-- +2.39.5 + diff --git a/debian/patches/series b/debian/patches/series index 2865533..35198f4 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -16,3 +16,4 @@ upstream/0001-use-raw-strings-for-regex-to-fix-backslash-interpret.patch upstream/0002-vxlan-add-support-for-IPv6-vxlan-local-tunnelip.patch pve/0014-nlmanager-read-ipv6-devconf-disable_ipv6-attribute-t.patch pve/0015-revert-addons-bond-warn-if-sub-interface-is-detected-on-bond-slave.patch +pve/0016-openvswitch-preserve-ovs-options-on-reload.patch -- 2.39.5