From: Gabriel Goller <g.goller@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH proxmox-perl-rs 1/2] pve-rs: sdn: fabrics: update openfabric/ospf route filtering
Date: Fri, 5 Sep 2025 13:44:59 +0200 [thread overview]
Message-ID: <20250905114504.195110-5-g.goller@proxmox.com> (raw)
In-Reply-To: <20250905114504.195110-1-g.goller@proxmox.com>
Some deserialization types have been updated on the common routes `ip
route ...` command. Update the filtering function accordingly.
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
---
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<Vec<RouteStatus>, 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<Vec<RouteStatus>, 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<HashMap<FabricId, Status>, 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
next prev parent reply other threads:[~2025-09-05 11:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-05 11:44 [pve-devel] [PATCH network/proxmox{-ve-rs, -perl-rs} 0/6] Add status endpoints for EVPN statistics Gabriel Goller
2025-09-05 11:44 ` [pve-devel] [PATCH proxmox-ve-rs 1/3] ve-config: add optional tag property to vnet Gabriel Goller
2025-09-05 11:44 ` [pve-devel] [PATCH proxmox-ve-rs 2/3] frr: fix some route deserialization types Gabriel Goller
2025-09-05 11:44 ` [pve-devel] [PATCH proxmox-ve-rs 3/3] frr: add deserialization types for EVPN Gabriel Goller
2025-09-05 11:44 ` Gabriel Goller [this message]
2025-09-05 11:45 ` [pve-devel] [PATCH proxmox-perl-rs 2/2] pve-rs: sdn: add functions to retrieve the Zone/Vnet routes Gabriel Goller
2025-09-05 11:45 ` [pve-devel] [PATCH pve-network 1/1] sdn: add vnet and zone status endpoints Gabriel Goller
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=20250905114504.195110-5-g.goller@proxmox.com \
--to=g.goller@proxmox.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