Skip to content

Commit

Permalink
fixup: Linux send errors
Browse files Browse the repository at this point in the history
  • Loading branch information
hulthe committed Jan 8, 2025
1 parent 4112824 commit 76272bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions leak-checker/src/traceroute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,10 @@ async fn send_icmp_probes<Impl: Traceroute>(
};

match e.kind() {
io::ErrorKind::PermissionDenied => {
// Linux returns this error if our packet was rejected by nftables.
log::debug!("send_to failed with 'permission denied'");
io::ErrorKind::PermissionDenied | io::ErrorKind::ConnectionRefused => {
// Linux returns one of these errors if our packet was rejected by nftables.
log::debug!("send_to failed, was probably caught by firewall");
break;
}
_ => return Err(e).context("Failed to send packet")?,
}
Expand Down
4 changes: 2 additions & 2 deletions leak-checker/src/traceroute/platform/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ async fn recv_ttl_responses(
} = recv_packet;

macro_rules! skip_if {
($skip_condition:expr, $message:expr) => {{
($skip_condition:expr, $note:expr) => {{
if $skip_condition {
log::debug!("Ignoring received packet: {}", $skip_condition);
log::debug!("Ignoring received message: {}", $note);
continue 'outer;
}
}};
Expand Down

0 comments on commit 76272bb

Please sign in to comment.