wgengine: fix the build on darwin, windows, openbsd.

7e5e3277 changed the Router interface definition, but forgot to
fix up these platform files.

Signed-off-by: David Anderson <dave@natulte.net>
This commit is contained in:
David Anderson 2020-02-12 16:16:05 -08:00
parent 67c1b2c6ef
commit 36f5433476
3 changed files with 7 additions and 3 deletions

View File

@ -32,5 +32,6 @@ func (r *darwinRouter) SetRoutes(rs RouteSettings) error {
return nil
}
func (r *darwinRouter) Close() {
func (r *darwinRouter) Close() error {
return nil
}

View File

@ -155,7 +155,7 @@ func (r *openbsdRouter) SetRoutes(rs RouteSettings) error {
return errq
}
func (r *openbsdRouter) Close() {
func (r *openbsdRouter) Close() error {
out, err := cmd("ifconfig", r.tunname, "down").CombinedOutput()
if err != nil {
r.logf("running ifconfig failed: %v\n%s", err, out)
@ -166,6 +166,8 @@ func (r *openbsdRouter) Close() {
}
// TODO(mbaillie): wipe routes
return nil
}
// TODO(mbaillie): these are no-ops for now. They could re-use the Linux funcs

View File

@ -51,8 +51,9 @@ func (r *winRouter) SetRoutes(rs RouteSettings) error {
return nil
}
func (r *winRouter) Close() {
func (r *winRouter) Close() error {
if r.routeChangeCallback != nil {
r.routeChangeCallback.Unregister()
}
return nil
}