From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id D48731FF15C for ; Fri, 5 Sep 2025 13:45:39 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8ADDC134C5; Fri, 5 Sep 2025 13:45:42 +0200 (CEST) From: Gabriel Goller To: pve-devel@lists.proxmox.com Date: Fri, 5 Sep 2025 13:44:59 +0200 Message-ID: <20250905114504.195110-5-g.goller@proxmox.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250905114504.195110-1-g.goller@proxmox.com> References: <20250905114504.195110-1-g.goller@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1757072690552 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.005 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [status.rs] Subject: [pve-devel] [PATCH proxmox-perl-rs 1/2] pve-rs: sdn: fabrics: update openfabric/ospf route filtering X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Some deserialization types have been updated on the common routes `ip route ...` command. Update the filtering function accordingly. Signed-off-by: Gabriel Goller --- pve-rs/src/sdn/status.rs | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/pve-rs/src/sdn/status.rs b/pve-rs/src/sdn/status.rs index fc8c19bbcf53..81253732472e 100644 --- a/pve-rs/src/sdn/status.rs +++ b/pve-rs/src/sdn/status.rs @@ -150,9 +150,11 @@ pub fn get_routes(routes: RoutesParsed) -> Result, anyhow::Erro let mut route_belongs_to_fabric = false; for route in route_list { for nexthop in &route.nexthops { - if interface_names.contains(&nexthop.interface_name.as_str()) { - route_belongs_to_fabric = true; - break; + if let Some(iface_name) = &nexthop.interface_name { + if interface_names.contains(iface_name.as_str()) { + route_belongs_to_fabric = true; + break; + } } } if route_belongs_to_fabric { @@ -166,8 +168,12 @@ pub fn get_routes(routes: RoutesParsed) -> Result, anyhow::Erro for nexthop in &route.nexthops { let via = if let Some(ip) = nexthop.ip { ip.to_string() + } else if let Some(iface_name) = &nexthop.interface_name { + iface_name.clone() + } else if let Some(true) = &nexthop.unreachable { + "unreachable".to_string() } else { - nexthop.interface_name.clone() + continue; }; via_list.push(via); } @@ -314,10 +320,13 @@ pub fn get_status(routes: RoutesParsed) -> Result, any // determine status by checking if any routes exist for our interfaces let has_routes = all_routes.values().any(|v| { v.iter().any(|route| { - route - .nexthops - .iter() - .any(|nexthop| interface_names.contains(&nexthop.interface_name.as_str())) + route.nexthops.iter().any(|nexthop| { + if let Some(iface_name) = &nexthop.interface_name { + interface_names.contains(iface_name.as_str()) + } else { + false + } + }) }) }); -- 2.47.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel