mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-15 19:22:53 +08:00
fix: SA4001 for net.UDPAddr copy
This commit is contained in:
parent
5de043acc6
commit
13111081be
|
@ -46,7 +46,8 @@ func handleUDPToLocal(packet C.UDPPacket, pc net.PacketConn, key string, oAddr,
|
|||
}
|
||||
|
||||
fromUDPAddr := from.(*net.UDPAddr)
|
||||
fromUDPAddr = &(*fromUDPAddr) // make a copy
|
||||
_fromUDPAddr := *fromUDPAddr
|
||||
fromUDPAddr = &_fromUDPAddr // make a copy
|
||||
if fromAddr, ok := netip.AddrFromSlice(fromUDPAddr.IP); ok {
|
||||
if fAddr.IsValid() && (oAddr.Unmap() == fromAddr.Unmap()) {
|
||||
fromUDPAddr.IP = fAddr.Unmap().AsSlice()
|
||||
|
|
Loading…
Reference in New Issue
Block a user