Simplify getting a hostinfo or starting a handshake with one (#954)

This commit is contained in:
Nate Brown 2023-08-21 18:51:45 -05:00 committed by GitHub
parent 7edcf620c0
commit 076ebc6c6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 158 additions and 215 deletions

View file

@ -165,15 +165,5 @@ func (c *Control) GetCert() *cert.NebulaCertificate {
}
func (c *Control) ReHandshake(vpnIp iputil.VpnIp) {
hostinfo := c.f.handshakeManager.AddVpnIp(vpnIp)
ixHandshakeStage0(c.f, vpnIp, hostinfo)
// If this is a static host, we don't need to wait for the HostQueryReply
// We can trigger the handshake right now
if _, ok := c.f.lightHouse.GetStaticHostList()[hostinfo.vpnIp]; ok {
select {
case c.f.handshakeManager.trigger <- hostinfo.vpnIp:
default:
}
}
c.f.handshakeManager.StartHandshake(vpnIp, nil)
}