From 36f5433476dc67e0e03a179f7d342c5de3b2acc8 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 12 Feb 2020 16:16:05 -0800 Subject: [PATCH] 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 --- wgengine/router_darwin.go | 3 ++- wgengine/router_openbsd.go | 4 +++- wgengine/router_windows.go | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/wgengine/router_darwin.go b/wgengine/router_darwin.go index c4c09ace4..0c17f28b1 100644 --- a/wgengine/router_darwin.go +++ b/wgengine/router_darwin.go @@ -32,5 +32,6 @@ func (r *darwinRouter) SetRoutes(rs RouteSettings) error { return nil } -func (r *darwinRouter) Close() { +func (r *darwinRouter) Close() error { + return nil } diff --git a/wgengine/router_openbsd.go b/wgengine/router_openbsd.go index 9a7f76a18..efb19a179 100644 --- a/wgengine/router_openbsd.go +++ b/wgengine/router_openbsd.go @@ -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 diff --git a/wgengine/router_windows.go b/wgengine/router_windows.go index c05b81b3e..eefa433ec 100644 --- a/wgengine/router_windows.go +++ b/wgengine/router_windows.go @@ -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 }