Skip to content

Commit

Permalink
udpnat2: Fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Feb 10, 2025
1 parent d8153df commit 9eafc7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/udpnat2/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down

0 comments on commit 9eafc7f

Please sign in to comment.