1
0
mirror of https://github.com/juanfont/headscale.git synced 2025-07-27 13:48:02 +02:00

use slices clone

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
Kristoffer Dalby 2025-03-17 09:32:45 +01:00
parent 36cbd4c2d6
commit dea7b9c617
No known key found for this signature in database

View File

@ -5,6 +5,8 @@ import (
"net/netip"
"time"
"slices"
"github.com/juanfont/headscale/hscontrol/policy"
"github.com/juanfont/headscale/hscontrol/routes"
"github.com/juanfont/headscale/hscontrol/types"
@ -49,9 +51,8 @@ func tailNode(
) (*tailcfg.Node, error) {
addrs := node.Prefixes()
allowedIPs := append(
[]netip.Prefix{},
addrs...) // we append the node own IP, as it is required by the clients
// we append the node own IP, as it is required by the clients
allowedIPs := slices.Clone(node.Prefixes())
for _, route := range node.SubnetRoutes() {
allowedIPs = append(allowedIPs, netip.Prefix(route))