Skip to content

Commit

Permalink
fix(tracer): Handle TimeExceeded responses are from the target address
Browse files Browse the repository at this point in the history
Observed some target (i.e. 213.189.4.73) which respond with an ICMP `TimeExceeded`, despite being the target
  • Loading branch information
fujiapple852 committed May 13, 2022
1 parent c460720 commit 3afa413
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/tracing/tracer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ impl<F: Fn(&TracerRound<'_>)> Tracer<F> {
let sequence = Sequence(data.sequence);
let received = data.recv;
let ip = data.addr;
let is_target = ip == self.target_addr;
let trace_id = TraceId::from(data.identifier);
if self.check_trace_id(trace_id) && st.in_round(sequence) {
let probe = st
Expand All @@ -151,7 +152,7 @@ impl<F: Fn(&TracerRound<'_>)> Tracer<F> {
.with_icmp_packet_type(IcmpPacketType::TimeExceeded)
.with_host(ip)
.with_received(received);
st.update_probe(sequence, probe, received, false);
st.update_probe(sequence, probe, received, is_target);
}
}
Some(ProbeResponse::DestinationUnreachable(data)) => {
Expand Down

0 comments on commit 3afa413

Please sign in to comment.