Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix router panic when configured with linkstate peer routing mode (#562) #595

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions zenoh/src/net/routing/pubsub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1421,7 +1421,10 @@ pub(super) fn compute_data_routes_(tables: &Tables, res: &Arc<Resource>) -> Data
compute_data_route(tables, &mut expr, Some(idx.index()), WhatAmI::Router);
}

routes.peer_data_route = Some(compute_data_route(tables, &mut expr, None, WhatAmI::Peer));
if !tables.full_net(WhatAmI::Peer) {
routes.peer_data_route =
Some(compute_data_route(tables, &mut expr, None, WhatAmI::Peer));
}
}
if (tables.whatami == WhatAmI::Router || tables.whatami == WhatAmI::Peer)
&& tables.full_net(WhatAmI::Peer)
Expand Down Expand Up @@ -1479,8 +1482,10 @@ pub(crate) fn compute_data_routes(tables: &mut Tables, res: &mut Arc<Resource>)
compute_data_route(tables, &mut expr, Some(idx.index()), WhatAmI::Router);
}

res_mut.context_mut().peer_data_route =
Some(compute_data_route(tables, &mut expr, None, WhatAmI::Peer));
if !tables.full_net(WhatAmI::Peer) {
res_mut.context_mut().peer_data_route =
Some(compute_data_route(tables, &mut expr, None, WhatAmI::Peer));
}
}
if (tables.whatami == WhatAmI::Router || tables.whatami == WhatAmI::Peer)
&& tables.full_net(WhatAmI::Peer)
Expand Down
11 changes: 8 additions & 3 deletions zenoh/src/net/routing/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1529,7 +1529,10 @@ pub(super) fn compute_query_routes_(tables: &Tables, res: &Arc<Resource>) -> Que
compute_query_route(tables, &mut expr, Some(idx.index()), WhatAmI::Router);
}

routes.peer_query_route = Some(compute_query_route(tables, &mut expr, None, WhatAmI::Peer));
if !tables.full_net(WhatAmI::Peer) {
routes.peer_query_route =
Some(compute_query_route(tables, &mut expr, None, WhatAmI::Peer));
}
}
if (tables.whatami == WhatAmI::Router || tables.whatami == WhatAmI::Peer)
&& tables.full_net(WhatAmI::Peer)
Expand Down Expand Up @@ -1595,8 +1598,10 @@ pub(crate) fn compute_query_routes(tables: &mut Tables, res: &mut Arc<Resource>)
compute_query_route(tables, &mut expr, Some(idx.index()), WhatAmI::Router);
}

res_mut.context_mut().peer_query_route =
Some(compute_query_route(tables, &mut expr, None, WhatAmI::Peer));
if !tables.full_net(WhatAmI::Peer) {
res_mut.context_mut().peer_query_route =
Some(compute_query_route(tables, &mut expr, None, WhatAmI::Peer));
}
}
if (tables.whatami == WhatAmI::Router || tables.whatami == WhatAmI::Peer)
&& tables.full_net(WhatAmI::Peer)
Expand Down
Loading