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.
"github.com/tailscale/wireguard-go/tun"
"inet.af/netaddr"
+ "tailscale.com/net/tsaddr"
"tailscale.com/types/logger"
"tailscale.com/version"
)
@@ -134,6 +135,12 @@ func (r *userspaceBSDRouter) Set(cfg *Config) (reterr error) {
newRoutes := make(map[netaddr.IPPrefix]struct{})
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{}{}
}
// Delete any pre-existing routes.
