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:
parent
36cbd4c2d6
commit
dea7b9c617
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user