From f87985073ebaaa9962c2394b6d87b4131b422d2a Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Tue, 20 Oct 2026 18:04:41 +0000 Subject: [PATCH] servertest: count deleted nodes in replayed peer views Only nodes still in State resolved to an alias, so a client that kept a deleted peer passed the peers and route owner checks. --- hscontrol/servertest/via_ha_compat_test.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hscontrol/servertest/via_ha_compat_test.go b/hscontrol/servertest/via_ha_compat_test.go index 54db6749d..6c4e8b28c 100644 --- a/hscontrol/servertest/via_ha_compat_test.go +++ b/hscontrol/servertest/via_ha_compat_test.go @@ -1229,7 +1229,8 @@ func (r *stepReplay) saasAlias(id tailcfg.NodeID) (string, bool) { return "", false } -// hsAlias is the alias whose machine holds node id. +// hsAlias is the alias whose machine holds node id, or last held it: a +// deleted node a client still lists must count, as saasAlias counts it. func (r *stepReplay) hsAlias(id tailcfg.NodeID) (string, bool) { for alias := range r.clients { for _, nv := range r.machineNodes(alias) { @@ -1239,6 +1240,12 @@ func (r *stepReplay) hsAlias(id tailcfg.NodeID) (string, bool) { } } + for alias, last := range r.lastIDs { + if last == strconv.FormatInt(int64(id), 10) { + return alias, true + } + } + return "", false }