From 374a6eef7e1375ad9665a29ef384d39a0bd21a65 Mon Sep 17 00:00:00 2001 From: Juan Font Alonso Date: Sat, 15 May 2021 18:12:22 +0200 Subject: [PATCH] Fixed panic when sending keep alives to a disconnected node --- api.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api.go b/api.go index 56d858ca..3c9c0ae6 100644 --- a/api.go +++ b/api.go @@ -279,12 +279,14 @@ func (h *Headscale) keepAlive(cancel chan []byte, pollData chan []byte, mKey wgc return default: + h.pollMu.Lock() data, err := h.getMapKeepAliveResponse(mKey, req, m) if err != nil { log.Printf("Error generating the keep alive msg: %s", err) return } pollData <- *data + h.pollMu.Unlock() time.Sleep(60 * time.Second) } }