diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-06-10 11:02:18 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-06-10 11:03:36 +0200 |
commit | a304f69e0dde3984b131d1cf29d22f19b4e5e083 (patch) | |
tree | 3447d3c1bddae3a865ca69cf85e0cf186c36e710 /tun/tun_windows.go | |
parent | baafe92888c2485e31594f57c37ee29ca8c12b4e (diff) |
wintun: fix comments and remove hwnd param
This now looks more idiomatic.
Diffstat (limited to 'tun/tun_windows.go')
-rw-r--r-- | tun/tun_windows.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tun/tun_windows.go b/tun/tun_windows.go index 1881e5b..4850bb5 100644 --- a/tun/tun_windows.go +++ b/tun/tun_windows.go @@ -72,24 +72,24 @@ func CreateTUNWithRequestedGUID(ifname string, requestedGUID *windows.GUID) (TUN var wt *wintun.Wintun // Does an interface with this name already exist? - wt, err = wintun.GetInterface(ifname, 0) + wt, err = wintun.GetInterface(ifname) if err == nil { // If so, we delete it, in case it has weird residual configuration. - _, err = wt.DeleteInterface(0) + _, err = wt.DeleteInterface() if err != nil { return nil, fmt.Errorf("Unable to delete already existing Wintun interface: %v", err) } } else if err == windows.ERROR_ALREADY_EXISTS { return nil, fmt.Errorf("Foreign network interface with the same name exists") } - wt, _, err = wintun.CreateInterface("WireGuard Tunnel Adapter", requestedGUID, 0) + wt, _, err = wintun.CreateInterface("WireGuard Tunnel Adapter", requestedGUID) if err != nil { return nil, fmt.Errorf("Unable to create Wintun interface: %v", err) } err = wt.SetInterfaceName(ifname) if err != nil { - wt.DeleteInterface(0) + wt.DeleteInterface() return nil, fmt.Errorf("Unable to set name of Wintun interface: %v", err) } @@ -214,7 +214,7 @@ func (tun *NativeTun) Close() error { close(tun.events) } - _, err2 := tun.wt.DeleteInterface(0) + _, err2 := tun.wt.DeleteInterface() if err1 == nil { err1 = err2 } |