This commit is contained in:
JackDoan 2025-09-04 14:12:27 -05:00
parent eec0cd34f4
commit 47ca7521bc

View file

@ -631,13 +631,19 @@ func (lh *LightHouse) addCalculatedRemotes(vpnAddr netip.Addr) bool {
return len(calculatedV4) > 0 || len(calculatedV6) > 0 return len(calculatedV4) > 0 || len(calculatedV6) > 0
} }
// unlockedGetRemoteList // unlockedGetRemoteList assumes you have the lh lock
// assumes you have the lh lock
func (lh *LightHouse) unlockedGetRemoteList(allAddrs []netip.Addr) *RemoteList { func (lh *LightHouse) unlockedGetRemoteList(allAddrs []netip.Addr) *RemoteList {
// before we go and make a new remotelist, we need to make sure we don't have one for any of this set of vpnaddrs yet // before we go and make a new remotelist, we need to make sure we don't have one for any of this set of vpnaddrs yet
for _, addr := range allAddrs { for i, addr := range allAddrs {
am, ok := lh.addrMap[addr] am, ok := lh.addrMap[addr]
if ok { if ok {
if i != 0 {
//if we had a record in the cache for a non-primary IPI
for _, x := range allAddrs {
lh.addrMap[x] = am
}
lh.addrMap[addr] = am
}
return am return am
} }
} }