Skip to content

Commit

Permalink
chore(shadowsocks): better formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
zonyitoo committed Jun 16, 2024
1 parent 5c59fba commit bedfe34
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions crates/shadowsocks/src/net/sys/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
));
}
},
}
},
}

Expand Down

0 comments on commit bedfe34

Please sign in to comment.