Chore: udp resolve ip on local
This commit is contained in:
parent
b0f9c6afa8
commit
72c0af9739
1 changed files with 9 additions and 0 deletions
|
@ -175,6 +175,15 @@ func (t *Tunnel) handleUDPConn(packet *inbound.PacketAdapter) {
|
|||
return
|
||||
}
|
||||
|
||||
if metadata.DstIP == nil {
|
||||
ip, err := t.resolveIP(metadata.Host)
|
||||
if err != nil {
|
||||
log.Warnln("[UDP] Resolve %s failed: %s, %#v", metadata.Host, err.Error(), metadata)
|
||||
return
|
||||
}
|
||||
metadata.DstIP = ip
|
||||
}
|
||||
|
||||
key := packet.LocalAddr().String()
|
||||
|
||||
pc := t.natTable.Get(key)
|
||||
|
|
Loading…
Reference in a new issue