chore(shadowsocks): better formatting

This commit is contained in:
zonyitoo
2024-06-16 22:43:03 +08:00
parent 5c59fba427
commit bedfe34fcd
+4 -5
View File
@@ -192,15 +192,14 @@ fn check_ipv4_mapped_ipv6_capability() -> io::Result<()> {
None => return Err(io::Error::new(ErrorKind::Other, "invalid local_addr")),
Some(addr) => match addr {
SocketAddr::V4(..) => return Err(io::Error::new(ErrorKind::Other, "local_addr returned an IPv4 address")),
SocketAddr::V6(v6) => match v6.ip().to_ipv4_mapped() {
Some(_) => {}
None => {
SocketAddr::V6(v6) => {
if v6.ip().to_ipv4_mapped().is_none() {
return Err(io::Error::new(
ErrorKind::Other,
"local_addr returned an non IPv4-mapped-IPv6 address",
"local_addr returned a non IPv4-mapped-IPv6 address",
));
}
},
}
},
}