mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2025-12-20 17:10:08 +08:00
fix: get localAddr error
This commit is contained in:
parent
455f2136f1
commit
ccff0035cb
@ -213,10 +213,8 @@ func (h *ListenerHandler) NewPacket(ctx context.Context, key netip.AddrPort, buf
|
|||||||
rAddr: metadata.Source.UDPAddr(),
|
rAddr: metadata.Source.UDPAddr(),
|
||||||
buff: buffer,
|
buff: buffer,
|
||||||
}
|
}
|
||||||
if conn, ok := common.Cast[localAddr](writer); ok {
|
if conn, ok := common.Cast[localAddr](writer); ok { // tun does not have real inAddr
|
||||||
cPacket.rAddr = conn.LocalAddr()
|
cPacket.lAddr = conn.LocalAddr()
|
||||||
} else {
|
|
||||||
cPacket.rAddr = metadata.Source.UDPAddr() // tun does not have real inAddr
|
|
||||||
}
|
}
|
||||||
h.handlePacket(ctx, cPacket, metadata.Source, metadata.Destination)
|
h.handlePacket(ctx, cPacket, metadata.Source, metadata.Destination)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user