From d42ae75a9e09a18dd17226d0f916d90b2a4e6f76 Mon Sep 17 00:00:00 2001 From: heinrich5991 Date: Thu, 8 Aug 2024 00:00:41 +0200 Subject: [PATCH] Use `Ipv6::to_ipv4_mapped` in mastersrv Needs Rust 1.63.0, should be old enough at this point. --- src/mastersrv/src/main.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/mastersrv/src/main.rs b/src/mastersrv/src/main.rs index 8bd9a9348..c16f06596 100644 --- a/src/mastersrv/src/main.rs +++ b/src/mastersrv/src/main.rs @@ -1009,11 +1009,8 @@ async fn main() { addr.unwrap().ip() }; if let IpAddr::V6(v6) = addr { - if let Some(v4) = v6.to_ipv4() { - // TODO: switch to `to_ipv4_mapped` in the future. - if !v6.is_loopback() { - addr = IpAddr::from(v4); - } + if let Some(v4) = v6.to_ipv4_mapped() { + addr = IpAddr::from(v4); } } Ok(addr)