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

@@ -196,7 +196,11 @@ func (c *PacketConn) ReadFrom(p []byte) (n int, addr net.Addr, err error) {
if err != nil {
return
}
addr = c.destination.UDPAddr()
if c.destination.IsFqdn() {
addr = c.destination
} else {
addr = c.destination.UDPAddr()
}
return
}