router: Don't try to route around target dot

This was causing a panic, as it's not possible to route from *around* a
dot *into* the same dot.
This commit is contained in:
Mikolaj Wielgus 2023-10-17 03:55:21 +00:00
parent c9d0b2178e
commit 087d1deea0
1 changed files with 5 additions and 4 deletions

View File

@ -53,7 +53,8 @@ impl<'a, RO: RouterObserver> AstarStrategy<&Mesh, u64> for RouterAstarStrategy<'
fn edge_cost(&mut self, edge: MeshEdgeReference) -> Option<u64> {
self.observer.before_probe(&self.tracer, &self.trace, edge);
if self
if edge.target() != self.to
&& self
.tracer
.step(&mut self.trace, edge.target(), 5.0)
.is_ok()