From a82a7fe2ad861a920dcc6db05c6f28065ff7700a Mon Sep 17 00:00:00 2001 From: DaZuo0122 <1085701449@qq.com> Date: Sat, 17 Jan 2026 19:10:52 +0800 Subject: [PATCH] Add: include interface pickup failure in log --- crates/wtfnet-dnsleak/src/sensor.rs | 10 ++++++++-- docs/dns_leak_implementation_status.md | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/crates/wtfnet-dnsleak/src/sensor.rs b/crates/wtfnet-dnsleak/src/sensor.rs index 777520c..510571e 100644 --- a/crates/wtfnet-dnsleak/src/sensor.rs +++ b/crates/wtfnet-dnsleak/src/sensor.rs @@ -309,8 +309,14 @@ fn select_interface( let ordered = order_interfaces(&interfaces); for iface in ordered.iter() { debug!("dns leak iface pick: try={}", iface.name); - if let Ok(channel) = open_channel_with_timeout(iface.clone(), config) { - return Ok(channel); + match open_channel_with_timeout(iface.clone(), config) { + Ok(channel) => return Ok(channel), + Err(err) => { + debug!( + "dns leak iface pick: failed iface={} err={}", + iface.name, err + ); + } } } diff --git a/docs/dns_leak_implementation_status.md b/docs/dns_leak_implementation_status.md index d54b6e3..1064898 100644 --- a/docs/dns_leak_implementation_status.md +++ b/docs/dns_leak_implementation_status.md @@ -26,7 +26,7 @@ This document tracks the current DNS leak detector implementation against the de - Interface selection: - per-interface open timeout to avoid capture hangs - ordered scan prefers non-loopback + named ethernet/wlan and interfaces with IPs - - verbose logging of interface selection attempts (use `-v` / `-vv`) + - verbose logging of interface selection attempts + failures (use `-v` / `-vv`) - overall watch timeout accounts for worst-case interface scan time - Capture loop: - receiver runs in a worker thread; main loop polls with a short timeout to avoid blocking