diff --git a/common/udpnat2/service.go b/common/udpnat2/service.go index 14022118..f658fa25 100644 --- a/common/udpnat2/service.go +++ b/common/udpnat2/service.go @@ -27,7 +27,7 @@ func New(handler N.UDPConnectionHandlerEx, prepare PrepareFunc, timeout time.Dur } var cache freelru.Cache[netip.AddrPort, *natConn] if !shared { - cache = common.Must1(freelru.New[netip.AddrPort, *natConn](1024, maphash.NewHasher[netip.AddrPort]().Hash32)) + cache = common.Must1(freelru.NewSynced[netip.AddrPort, *natConn](1024, maphash.NewHasher[netip.AddrPort]().Hash32)) } else { cache = common.Must1(freelru.NewSharded[netip.AddrPort, *natConn](1024, maphash.NewHasher[netip.AddrPort]().Hash32)) }