From f2da1a1665cc53fe4c426af0b11d6fc24b2ec591 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Sun, 18 Sep 2022 12:14:49 +0200 Subject: [PATCH] Add comment and update changelog Signed-off-by: Kristoffer Dalby --- CHANGELOG.md | 1 + machine.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf0afb7f..ac1e3832 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Target Go 1.19 for Headscale [#778](https://github.com/juanfont/headscale/pull/778) - Target Tailscale v1.30.0 to build Headscale [#780](https://github.com/juanfont/headscale/pull/780) - Give a warning when running Headscale with reverse proxy improperly configured for WebSockets [#788](https://github.com/juanfont/headscale/pull/788) +- Fix subnet routers with Primary Routes [#811](https://github.com/juanfont/headscale/pull/811) ## 0.16.4 (2022-08-21) diff --git a/machine.go b/machine.go index ad31c860..92d714e7 100644 --- a/machine.go +++ b/machine.go @@ -642,6 +642,11 @@ func (machine Machine) toNode( allowedIPs = append(allowedIPs, machine.EnabledRoutes...) + // TODO(kradalby): This is kind of a hack where we say that + // all the announced routes (except exit), is presented as primary + // routes. This might be problematic if two nodes expose the same route. + // This was added to address an issue where subnet routers stopped working + // when we only populated AllowedIPs. primaryRoutes := []netip.Prefix{} if len(machine.EnabledRoutes) > 0 { for _, route := range machine.EnabledRoutes {