Merge pull request #8697 from heinrich5991/pr_ddnet_to_ipv4_mapped

Use `Ipv6::to_ipv4_mapped` in mastersrv
This commit is contained in:
Dennis Felsing 2024-08-07 22:19:45 +00:00 committed by GitHub
commit 9be9a902e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1009,13 +1009,10 @@ 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() {
if let Some(v4) = v6.to_ipv4_mapped() {
addr = IpAddr::from(v4);
}
}
}
Ok(addr)
};