From 2622e8e0829d46fe63dc49c7511d896430fa1e74 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Thu, 6 Aug 2020 17:37:05 -0700 Subject: [PATCH] wgenginer/router: fix build Rebasing github.com/tailscale/wireguard-go to upstream wireguard-go changed the API. This commit is analogous to https://git.zx2c4.com/wireguard-windows/commit/?id=6823cc10ffe193c0cb1d61a5d1828d563d3d0e5f --- wgengine/router/ifconfig_windows.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wgengine/router/ifconfig_windows.go b/wgengine/router/ifconfig_windows.go index 410e4facb..a9b99b89b 100644 --- a/wgengine/router/ifconfig_windows.go +++ b/wgengine/router/ifconfig_windows.go @@ -18,6 +18,7 @@ import ( ole "github.com/go-ole/go-ole" winipcfg "github.com/tailscale/winipcfg-go" + "github.com/tailscale/wireguard-go/conn" "github.com/tailscale/wireguard-go/device" "github.com/tailscale/wireguard-go/tun" "golang.org/x/sys/windows" @@ -58,11 +59,15 @@ func bindSocketRoute(family winipcfg.AddressFamily, device *device.Device, ourLu } *lastLuid = luid if false { + bind, ok := device.Bind().(conn.BindSocketToInterface) + if !ok { + return fmt.Errorf("unexpected device.Bind type %T", device.Bind()) + } // TODO(apenwarr): doesn't work with magic socket yet. if family == winipcfg.AF_INET { - return device.BindSocketToInterface4(index, false) + return bind.BindSocketToInterface4(index, false) } else if family == winipcfg.AF_INET6 { - return device.BindSocketToInterface6(index, false) + return bind.BindSocketToInterface6(index, false) } } else { log.Printf("WARNING: skipping windows socket binding.\n")