Pull hostmap and pending hostmap apart, remove unused functions (#843)

This commit is contained in:
Nate Brown 2023-07-24 12:37:52 -05:00 committed by GitHub
parent 52c9e360e7
commit a10baeee92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 292 additions and 295 deletions

View file

@ -147,12 +147,12 @@ func (c *Control) GetUDPAddr() string {
}
func (c *Control) KillPendingTunnel(vpnIp net.IP) bool {
hostinfo, ok := c.f.handshakeManager.pendingHostMap.Hosts[iputil.Ip2VpnIp(vpnIp)]
if !ok {
hostinfo := c.f.handshakeManager.QueryVpnIp(iputil.Ip2VpnIp(vpnIp))
if hostinfo == nil {
return false
}
c.f.handshakeManager.pendingHostMap.DeleteHostInfo(hostinfo)
c.f.handshakeManager.DeleteHostInfo(hostinfo)
return true
}