Fix processing domain address in packet

This commit is contained in:
世界
2023-04-12 20:44:17 +08:00
parent ed37cb858b
commit bd9e6e5cd9
9 changed files with 52 additions and 18 deletions

View File

@@ -198,7 +198,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
}