Add: verbose for dns leak iface picking process
This commit is contained in:
@@ -265,6 +265,7 @@ fn select_interface(
|
|||||||
) -> Result<(datalink::NetworkInterface, Box<dyn datalink::DataLinkReceiver>), DnsLeakError> {
|
) -> Result<(datalink::NetworkInterface, Box<dyn datalink::DataLinkReceiver>), DnsLeakError> {
|
||||||
let interfaces = datalink::interfaces();
|
let interfaces = datalink::interfaces();
|
||||||
if let Some(name) = name {
|
if let Some(name) = name {
|
||||||
|
debug!("dns leak iface pick: requested={name}");
|
||||||
let iface = interfaces
|
let iface = interfaces
|
||||||
.iter()
|
.iter()
|
||||||
.find(|iface| iface.name == name)
|
.find(|iface| iface.name == name)
|
||||||
@@ -284,12 +285,14 @@ fn select_interface(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let Some(iface) = pick_stable_iface(&interfaces) {
|
if let Some(iface) = pick_stable_iface(&interfaces) {
|
||||||
|
debug!("dns leak iface pick: stable={}", iface.name);
|
||||||
if let Ok(channel) = open_channel_with_timeout(iface, config) {
|
if let Ok(channel) = open_channel_with_timeout(iface, config) {
|
||||||
return Ok(channel);
|
return Ok(channel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for iface in interfaces.iter() {
|
for iface in interfaces.iter() {
|
||||||
|
debug!("dns leak iface pick: try={}", iface.name);
|
||||||
if let Ok(channel) = open_channel_with_timeout(iface.clone(), config) {
|
if let Ok(channel) = open_channel_with_timeout(iface.clone(), config) {
|
||||||
return Ok(channel);
|
return Ok(channel);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ This document tracks the current DNS leak detector implementation against the de
|
|||||||
- Interface selection:
|
- Interface selection:
|
||||||
- per-interface open timeout to avoid capture hangs
|
- per-interface open timeout to avoid capture hangs
|
||||||
- stable default pick (up, non-loopback, named ethernet/wlan) before fallback scan
|
- stable default pick (up, non-loopback, named ethernet/wlan) before fallback scan
|
||||||
|
- verbose logging of interface selection attempts (use `-v` / `-vv`)
|
||||||
|
|
||||||
## Partially implemented
|
## Partially implemented
|
||||||
- Route/interface classification: heuristic only (loopback/tunnel/physical by iface name).
|
- Route/interface classification: heuristic only (loopback/tunnel/physical by iface name).
|
||||||
|
|||||||
Reference in New Issue
Block a user