pub fn is_dual_stack_addr(addr: &SocketAddr) -> bool {
    if let SocketAddr::V6(ref v6) = *addr {
        let ip = v6.ip();
        ip.is_unspecified() || ip.to_ipv4_mapped().is_some()
    } else {
        false
    }
}
Check if `SocketAddr` could be used for creating dual-stack sockets
crates/shadowsocks/src/net/mod.rs