Skip to content

Commit 9eafc7f

Browse files
committed
udpnat2: Fix crash
1 parent d8153df commit 9eafc7f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

common/udpnat2/service.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func New(handler N.UDPConnectionHandlerEx, prepare PrepareFunc, timeout time.Dur
2727
}
2828
var cache freelru.Cache[netip.AddrPort, *natConn]
2929
if !shared {
30-
cache = common.Must1(freelru.New[netip.AddrPort, *natConn](1024, maphash.NewHasher[netip.AddrPort]().Hash32))
30+
cache = common.Must1(freelru.NewSynced[netip.AddrPort, *natConn](1024, maphash.NewHasher[netip.AddrPort]().Hash32))
3131
} else {
3232
cache = common.Must1(freelru.NewSharded[netip.AddrPort, *natConn](1024, maphash.NewHasher[netip.AddrPort]().Hash32))
3333
}

0 commit comments

Comments
 (0)