mirror of
https://github.com/tailscale/tailscale.git
synced 2025-01-08 09:07:44 +00:00
wgengine/router: fix FreeBSD configuration failure on the v6 /48.
On FreeBSD, we add the interface IP as a /48 to work around a kernel bug, so we mustn't then try to add a /48 route to the Tailscale ULA, since that will fail as a dupe. Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
parent
58760f7b82
commit
19eca34f47
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
"github.com/tailscale/wireguard-go/tun"
|
"github.com/tailscale/wireguard-go/tun"
|
||||||
"inet.af/netaddr"
|
"inet.af/netaddr"
|
||||||
|
"tailscale.com/net/tsaddr"
|
||||||
"tailscale.com/types/logger"
|
"tailscale.com/types/logger"
|
||||||
"tailscale.com/version"
|
"tailscale.com/version"
|
||||||
)
|
)
|
||||||
@ -134,6 +135,12 @@ func (r *userspaceBSDRouter) Set(cfg *Config) (reterr error) {
|
|||||||
|
|
||||||
newRoutes := make(map[netaddr.IPPrefix]struct{})
|
newRoutes := make(map[netaddr.IPPrefix]struct{})
|
||||||
for _, route := range cfg.Routes {
|
for _, route := range cfg.Routes {
|
||||||
|
if route == tsaddr.TailscaleULARange() {
|
||||||
|
// Because we added the interface address as a /48 above,
|
||||||
|
// the kernel already created the Tailscale ULA route
|
||||||
|
// implicitly. We mustn't try to add/delete it ourselves.
|
||||||
|
continue
|
||||||
|
}
|
||||||
newRoutes[route] = struct{}{}
|
newRoutes[route] = struct{}{}
|
||||||
}
|
}
|
||||||
// Delete any pre-existing routes.
|
// Delete any pre-existing routes.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user