diff --git a/wgengine/userspace.go b/wgengine/userspace.go index f50b5ade3..363ffbb45 100644 --- a/wgengine/userspace.go +++ b/wgengine/userspace.go @@ -13,6 +13,7 @@ import ( "math" "net/netip" "runtime" + "slices" "strings" "sync" "time" @@ -1040,9 +1041,8 @@ func (e *userspaceEngine) getStatus() (*Status, error) { e.mu.Lock() closing := e.closing - peerKeys := make([]key.NodePublic, len(e.peerSequence)) - copy(peerKeys, e.peerSequence) - localAddrs := append([]tailcfg.Endpoint(nil), e.endpoints...) + peerKeys := slices.Clone(e.peerSequence) + localAddrs := slices.Clone(e.endpoints) e.mu.Unlock() if closing {