Skip to content

Commit

Permalink
Migrate bgpsim-web to new bgpsim version
Browse files Browse the repository at this point in the history
  • Loading branch information
tiborschneider committed Nov 21, 2024
1 parent 09d6973 commit c289960
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion bgpsim-web/src/draw/forwarding_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,18 @@ fn get_paths(net: &Net, router: RouterId, prefix: Pfx) -> Vec<Vec<Point>> {
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()
Expand Down

0 comments on commit c289960

Please sign in to comment.