From 332fa2b8256a79ae696bc0a26b96d18d8ff3736b Mon Sep 17 00:00:00 2001 From: Don Stephan Date: Mon, 16 May 2022 12:29:57 -0500 Subject: [PATCH] fix panic in handleInvalidCertificate (#675) * fix panic in handleInvalidCertificate when HandleMonitorTick fires, the hostmap can be nil which causes a panic to occur when trying to clean up the hostmap in handleInvalidCertificate. This fix just stops the invalidation from continuing if the hostmap doesn't exist. * removed conditional for disconnectInvalid in HandleDeletionTick --- connection_manager.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/connection_manager.go b/connection_manager.go index 9a51fa2..ea0ffc0 100644 --- a/connection_manager.go +++ b/connection_manager.go @@ -230,12 +230,9 @@ func (n *connectionManager) HandleDeletionTick(now time.Time) { hostinfo, err := n.hostMap.QueryVpnIp(vpnIp) if err != nil { n.l.Debugf("Not found in hostmap: %s", vpnIp) - - if !n.intf.disconnectInvalid { - n.ClearIP(vpnIp) - n.ClearPendingDeletion(vpnIp) - continue - } + n.ClearIP(vpnIp) + n.ClearPendingDeletion(vpnIp) + continue } if n.handleInvalidCertificate(now, vpnIp, hostinfo) {