Add: include interface pickup failure in log

This commit is contained in:
DaZuo0122
2026-01-17 19:10:52 +08:00
parent d5b92ede7b
commit a82a7fe2ad
2 changed files with 9 additions and 3 deletions

View File

@@ -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
);
}
}
}

View File

@@ -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