cmd/natc: cleanup unused state

perPeerState no longer needs to know the v6ULA.

Updates #14667

Signed-off-by: Fran Bull <fran@tailscale.com>
This commit is contained in:
Fran Bull
2025-04-14 13:51:59 -07:00
committed by franbull
parent 10fd61f1bb
commit 4cb9d5c183
4 changed files with 3 additions and 11 deletions

View File

@@ -24,7 +24,6 @@ var ErrNoIPsAvailable = errors.New("no IPs available")
type IPPool struct {
perPeerMap syncs.Map[tailcfg.NodeID, *perPeerState]
IPSet *netipx.IPSet
V6ULA netip.Prefix
}
func (ipp *IPPool) DomainForIP(from tailcfg.NodeID, addr netip.Addr) (string, bool) {
@@ -44,7 +43,6 @@ func (ipp *IPPool) DomainForIP(from tailcfg.NodeID, addr netip.Addr) (string, bo
func (ipp *IPPool) IPForDomain(from tailcfg.NodeID, domain string) (netip.Addr, error) {
npps := &perPeerState{
ipset: ipp.IPSet,
v6ULA: ipp.V6ULA,
}
ps, _ := ipp.perPeerMap.LoadOrStore(from, npps)
return ps.ipForDomain(domain)
@@ -52,7 +50,6 @@ func (ipp *IPPool) IPForDomain(from tailcfg.NodeID, domain string) (netip.Addr,
// perPeerState holds the state for a single peer.
type perPeerState struct {
v6ULA netip.Prefix
ipset *netipx.IPSet
mu sync.Mutex