From 17b3c612a1cf4ffd2b54af96f221dbc1edb1fa2f Mon Sep 17 00:00:00 2001 From: Igor Date: Wed, 18 Feb 2026 21:28:30 +0300 Subject: [PATCH] Handle IPv6 ENETUNREACH in STUN probe gracefully When IPv6 is unavailable on the host, treat NetworkUnreachable at connect() as Ok(None) instead of propagating an error, so the dual STUN probe succeeds with just the IPv4 result and no spurious WARN. Co-Authored-By: Claude Sonnet 4.6 --- src/network/stun.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/network/stun.rs b/src/network/stun.rs index 251454e..e796858 100644 --- a/src/network/stun.rs +++ b/src/network/stun.rs @@ -50,10 +50,11 @@ pub async fn stun_probe_family(stun_addr: &str, family: IpFamily) -> Result {} + Err(e) if e.kind() == std::io::ErrorKind::NetworkUnreachable => return Ok(None), + Err(e) => return Err(ProxyError::Proxy(format!("STUN connect failed: {e}"))), + } } else { return Ok(None); }