From c2899601a77f829f3a3b04cbccd3b81d38fc2d22 Mon Sep 17 00:00:00 2001 From: Tibor Schneider Date: Thu, 21 Nov 2024 12:04:46 +0100 Subject: [PATCH] Migrate bgpsim-web to new bgpsim version --- bgpsim-web/src/draw/forwarding_path.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bgpsim-web/src/draw/forwarding_path.rs b/bgpsim-web/src/draw/forwarding_path.rs index 1a8b723..8cfc6e4 100644 --- a/bgpsim-web/src/draw/forwarding_path.rs +++ b/bgpsim-web/src/draw/forwarding_path.rs @@ -125,9 +125,18 @@ fn get_paths(net: &Net, router: RouterId, prefix: Pfx) -> Vec> { if net.net().get_internal_router(router).is_ok() { match net.net().get_forwarding_state().get_paths(router, prefix) { Ok(paths) => paths, - Err(NetworkError::ForwardingBlackHole(p)) | Err(NetworkError::ForwardingLoop(p)) => { + Err(NetworkError::ForwardingBlackHole(p)) => { vec![p] } + Err(NetworkError::ForwardingLoop { + to_loop, + mut first_loop, + }) => { + if let Some(x) = first_loop.first().copied() { + first_loop.push(x); + } + vec![to_loop.into_iter().chain(first_loop).collect()] + } _ => unreachable!(), } .into_iter()