mirror of
https://github.com/juanfont/headscale.git
synced 2024-12-20 19:09:07 +01:00
Send in AllowedIPs both primary routes AND enabled exit routes
This commit is contained in:
parent
6de26b1d7c
commit
9b98c3b79f
10
machine.go
10
machine.go
@ -683,7 +683,15 @@ func (h *Headscale) toNode(
|
|||||||
}
|
}
|
||||||
primaryPrefixes := Routes(primaryRoutes).toPrefixes()
|
primaryPrefixes := Routes(primaryRoutes).toPrefixes()
|
||||||
|
|
||||||
allowedIPs = append(allowedIPs, primaryPrefixes...)
|
machineRoutes, err := h.GetMachineRoutes(&machine)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
for _, route := range machineRoutes {
|
||||||
|
if route.Enabled && (route.IsPrimary || route.isExitRoute()) {
|
||||||
|
allowedIPs = append(allowedIPs, netip.Prefix(route.Prefix))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var derp string
|
var derp string
|
||||||
if machine.HostInfo.NetInfo != nil {
|
if machine.HostInfo.NetInfo != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user