refactor: New tun udpnat

This commit is contained in:
世界
2026-07-16 21:35:01 +08:00
parent 64f833d8f7
commit c8ee3497b2
27 changed files with 428 additions and 102 deletions
+2 -2
View File
@@ -38,7 +38,7 @@ type socketDiagConn struct {
}
type uidProcessPathCache struct {
cache freelru.Cache[uint32, *uidProcessPaths]
cache *freelru.Cache[uint32, *uidProcessPaths]
}
type uidProcessPaths struct {
@@ -85,7 +85,7 @@ func socketDiagSettings(network string, source netip.AddrPort) (family, protocol
}
func newUIDProcessPathCache(ttl time.Duration) *uidProcessPathCache {
cache := common.Must1(freelru.NewSharded[uint32, *uidProcessPaths](64, maphash.NewHasher[uint32]().Hash32))
cache := common.Must1(freelru.New[uint32, *uidProcessPaths](64, maphash.NewHasher[uint32]().Hash32, true))
cache.SetLifetime(ttl)
return &uidProcessPathCache{cache: cache}
}