diff options
author | Simon Rozman <simon@rozman.si> | 2020-11-25 12:54:26 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-11-25 13:58:11 +0100 |
commit | c9fabbd5bf12b7abae6f00fe666edec3a8af7106 (patch) | |
tree | d43e53c053ec9bd58ddc57360803604fdfedbd25 | |
parent | 4cc7a7a455b0796d6300a6f3ef69e9041ec900d4 (diff) |
wintun: log when reboot is suggested by Windows
Which really shouldn't happen. But it is a useful information for
troubleshooting.
Signed-off-by: Simon Rozman <simon@rozman.si>
-rw-r--r-- | tun/tun_windows.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tun/tun_windows.go b/tun/tun_windows.go index a132d06..238bee0 100644 --- a/tun/tun_windows.go +++ b/tun/tun_windows.go @@ -8,6 +8,7 @@ package tun import ( "errors" "fmt" + "log" "os" "sync/atomic" "time" @@ -84,10 +85,13 @@ func CreateTUNWithRequestedGUID(ifname string, requestedGUID *windows.GUID, mtu return nil, fmt.Errorf("Error deleting already existing interface: %w", err) } } - wt, _, err = WintunPool.CreateAdapter(ifname, requestedGUID) + wt, rebootRequired, err := WintunPool.CreateAdapter(ifname, requestedGUID) if err != nil { return nil, fmt.Errorf("Error creating interface: %w", err) } + if rebootRequired { + log.Println("Windows indicated a reboot is required.") + } forcedMTU := 1420 if mtu > 0 { |