public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Alexandre Derumier <aderumier@odiso.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH pve-network] network: add|del_fdb: fix learning check
Date: Mon, 21 Nov 2022 10:54:04 +0100	[thread overview]
Message-ID: <20221121095404.1628780-1-aderumier@odiso.com> (raw)

ovs port don't have sysfs path
"/sys/class/net/$iface/brport/learning"

We need to check if the value is undef too

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
 src/PVE/Network.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/PVE/Network.pm b/src/PVE/Network.pm
index 26d8cb1..d1d2e5e 100644
--- a/src/PVE/Network.pm
+++ b/src/PVE/Network.pm
@@ -300,7 +300,7 @@ sub add_bridge_fdb {
     my ($iface, $mac) = @_;
 
     my $learning = PVE::Tools::file_read_firstline("/sys/class/net/$iface/brport/learning");
-    return if $learning;
+    return if !defined($learning) || $learning == 1;
 
     my ($vmid, $devid) = &$parse_tap_device_name($iface, 1);
     return if !defined($vmid);
@@ -320,7 +320,7 @@ sub del_bridge_fdb {
     my ($iface, $mac) = @_;
 
     my $learning = PVE::Tools::file_read_firstline("/sys/class/net/$iface/brport/learning");
-    return if $learning;
+    return if !defined($learning) || $learning == 1;
 
     my ($vmid, $devid) = &$parse_tap_device_name($iface, 1);
     return if !defined($vmid);
-- 
2.30.2




             reply	other threads:[~2022-11-21  9:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-21  9:54 Alexandre Derumier [this message]
2022-11-21 10:23 ` [pve-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221121095404.1628780-1-aderumier@odiso.com \
    --to=aderumier@odiso.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal