-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
In shadowsocks/shadowsocks-android#2454, we found shadowsocks-rust handles the UDP relay incorrectly, which cause STUN and DNS (with checking the source address) tests failed.
The bug is related to these lines:
| let _ = Address::read_from(&mut cur).await?; |
Shadowsocks-rust ignores the "real" source address returned from remote, and didn't construct the relay packet with this address.
| let payload = assemble_packet(Address::SocketAddress(src), &pkt); |
To fix this issue in socks5-local, we should assemble the packet with the source address from shadowsocks remote.
In other implementations, we simply returns the plain packet (SOCKS5 address + payload) back to the socks5 client:
In the NAT redir mode, we need to rebind the UDP socket to the the "real" address to let the client think the packet is actually sent from that address.
Metadata
Metadata
Assignees
Labels
No labels