diff --git a/src/bin/stun_sans_io.rs b/src/bin/stun_sans_io.rs index 137f034..b54ff14 100644 --- a/src/bin/stun_sans_io.rs +++ b/src/bin/stun_sans_io.rs @@ -9,7 +9,7 @@ fn main() -> anyhow::Result<()> { let socket = UdpSocket::bind("0.0.0.0:0")?; let server = "stun.cloudflare.com:3478" .to_socket_addrs()? - .next() + .find(|addr| addr.is_ipv4()) .context("Failed to resolve hostname")?; let mut binding = StunBinding::new(server); diff --git a/src/bin/stun_sans_io_time.rs b/src/bin/stun_sans_io_time.rs index 53725f4..840ec1b 100644 --- a/src/bin/stun_sans_io_time.rs +++ b/src/bin/stun_sans_io_time.rs @@ -15,7 +15,7 @@ async fn main() -> anyhow::Result<()> { let socket = UdpSocket::bind("0.0.0.0:0").await?; let server = "stun.cloudflare.com:3478" .to_socket_addrs()? - .next() + .find(|addr| addr.is_ipv4()) .context("Failed to resolve hostname")?; let mut binding = StunBinding::new(server); let mut timer = Timer::default();