mirror of https://github.com/tailscale/tailscale/
wgengine/netstack: remove SubnetRouterWrapper
It was used when we only supported subnet routers on linux and would nil out the SubnetRoutes slice as no other router worked with it, but now we support subnet routers on ~all platforms. The field it was setting to nil is now only used for network logging and nowhere else, so keep the field but drop the SubnetRouterWrapper as it's not useful. Updates #cleanup Change-Id: Id03f9b6ec33e47ad643e7b66e07911945f25db79 Signed-off-by: Maisem Ali <maisem@tailscale.com>pull/11661/head
parent
fe22032fb3
commit
3f4c5daa15
@ -1,28 +0,0 @@
|
|||||||
// Copyright (c) Tailscale Inc & AUTHORS
|
|
||||||
// SPDX-License-Identifier: BSD-3-Clause
|
|
||||||
|
|
||||||
package netstack
|
|
||||||
|
|
||||||
import (
|
|
||||||
"tailscale.com/wgengine/router"
|
|
||||||
)
|
|
||||||
|
|
||||||
type subnetRouter struct {
|
|
||||||
router.Router
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewSubnetRouterWrapper returns a Router wrapper that prevents the
|
|
||||||
// underlying Router r from seeing any advertised subnet routes, as
|
|
||||||
// netstack will handle them instead.
|
|
||||||
func NewSubnetRouterWrapper(r router.Router) router.Router {
|
|
||||||
return &subnetRouter{
|
|
||||||
Router: r,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *subnetRouter) Set(c *router.Config) error {
|
|
||||||
if c != nil {
|
|
||||||
c.SubnetRoutes = nil // netstack will handle
|
|
||||||
}
|
|
||||||
return r.Router.Set(c)
|
|
||||||
}
|
|
Loading…
Reference in New Issue