From bcde02b8a9d004b877f001f1cf2e581d3bb1670a Mon Sep 17 00:00:00 2001 From: FujiApple Date: Sat, 20 Jul 2024 23:54:27 +0800 Subject: [PATCH] fix(core): calculate target hop from maximum hop per round (#1226) --- crates/trippy-core/src/state.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/trippy-core/src/state.rs b/crates/trippy-core/src/state.rs index c72f7806..c307b3db 100644 --- a/crates/trippy-core/src/state.rs +++ b/crates/trippy-core/src/state.rs @@ -407,7 +407,7 @@ impl FlowState { } const fn is_target(&self, hop: &Hop) -> bool { - self.highest_ttl == hop.ttl + self.highest_ttl_for_round == hop.ttl } const fn is_in_round(&self, hop: &Hop) -> bool { @@ -415,8 +415,8 @@ impl FlowState { } fn target_hop(&self) -> &Hop { - if self.highest_ttl > 0 { - &self.hops[usize::from(self.highest_ttl) - 1] + if self.highest_ttl_for_round > 0 { + &self.hops[usize::from(self.highest_ttl_for_round) - 1] } else { &self.hops[0] }