Skip to content

Commit a99699e

Browse files
authored
before removing a pending hostinfo in handshake_manager, make sure it's the one we wanted to delete (#1811)
1 parent 3615a79 commit a99699e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

handshake_manager.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,9 @@ func (hm *HandshakeManager) DeleteHostInfo(hostinfo *HostInfo) {
529529

530530
func (hm *HandshakeManager) unlockedDeleteHostInfo(hostinfo *HostInfo) {
531531
for _, addr := range hostinfo.vpnAddrs {
532-
delete(hm.vpnIps, addr)
532+
if cur, ok := hm.vpnIps[addr]; ok && cur.hostinfo == hostinfo {
533+
delete(hm.vpnIps, addr)
534+
}
533535
}
534536

535537
if len(hm.vpnIps) == 0 {

0 commit comments

Comments
 (0)