Add: verbose for dns leak iface picking process

This commit is contained in:
DaZuo0122
2026-01-17 18:53:07 +08:00
parent cfa96bde08
commit 144e801e13
2 changed files with 4 additions and 0 deletions

View File

@@ -265,6 +265,7 @@ fn select_interface(
) -> Result<(datalink::NetworkInterface, Box<dyn datalink::DataLinkReceiver>), DnsLeakError> {
let interfaces = datalink::interfaces();
if let Some(name) = name {
debug!("dns leak iface pick: requested={name}");
let iface = interfaces
.iter()
.find(|iface| iface.name == name)
@@ -284,12 +285,14 @@ fn select_interface(
}
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) {
return Ok(channel);
}
}
for iface in interfaces.iter() {
debug!("dns leak iface pick: try={}", iface.name);
if let Ok(channel) = open_channel_with_timeout(iface.clone(), config) {
return Ok(channel);
}