From 76272bb4466e1552258b2775cd98c29cb0c4d954 Mon Sep 17 00:00:00 2001 From: Joakim Hulthe Date: Wed, 8 Jan 2025 15:49:44 +0100 Subject: [PATCH] fixup: Linux send errors --- leak-checker/src/traceroute.rs | 7 ++++--- leak-checker/src/traceroute/platform/linux.rs | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/leak-checker/src/traceroute.rs b/leak-checker/src/traceroute.rs index a40eaca131c8..667e60a30fd3 100644 --- a/leak-checker/src/traceroute.rs +++ b/leak-checker/src/traceroute.rs @@ -273,9 +273,10 @@ async fn send_icmp_probes( }; 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")?, } diff --git a/leak-checker/src/traceroute/platform/linux.rs b/leak-checker/src/traceroute/platform/linux.rs index 3c5012298b14..4a56d2a9abc4 100644 --- a/leak-checker/src/traceroute/platform/linux.rs +++ b/leak-checker/src/traceroute/platform/linux.rs @@ -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; } }};