Fix processing domain address in packet

This commit is contained in:
世界
2023-04-12 20:44:17 +08:00
parent 34cc7f176e
commit 11c50c7558
6 changed files with 27 additions and 6 deletions

View File

@@ -413,7 +413,11 @@ func (c *ClientPacketAddrConn) ReadFrom(p []byte) (n int, addr net.Addr, err err
if err != nil {
return
}
addr = destination.UDPAddr()
if destination.IsFqdn() {
addr = destination
} else {
addr = destination.UDPAddr()
}
var length uint16
err = binary.Read(c.ExtendedConn, binary.BigEndian, &length)
if err != nil {