From acb645aa9d41d6d21fca2d67b9fd92180f2671fa Mon Sep 17 00:00:00 2001 From: Juan Font Alonso Date: Sun, 21 Feb 2021 21:03:25 +0100 Subject: [PATCH] Check that peers are registered when fetching them Fix from https://github.com/awsong/headscale --- machine.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/machine.go b/machine.go index f71c4f16..cee6289e 100644 --- a/machine.go +++ b/machine.go @@ -107,7 +107,7 @@ func (h *Headscale) getPeers(m Machine) (*[]*tailcfg.Node, error) { // Add user management here? machines := []Machine{} - if err = db.Where("machine_key <> ?", m.MachineKey).Find(&machines).Error; err != nil { + if err = db.Where("machine_key <> ? AND registered", m.MachineKey).Find(&machines).Error; err != nil { log.Printf("Error accessing db: %s", err) return nil, err }