Chore: udp resolve ip on local
This commit is contained in:
parent
623b13a1d0
commit
ea8ec7993f
1 changed files with 9 additions and 0 deletions
|
@ -175,6 +175,15 @@ func (t *Tunnel) handleUDPConn(packet *inbound.PacketAdapter) {
|
||||||
return
|
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()
|
key := packet.LocalAddr().String()
|
||||||
|
|
||||||
pc := t.natTable.Get(key)
|
pc := t.natTable.Get(key)
|
||||||
|
|
Loading…
Reference in a new issue