Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c9fabbd

Browse files
rozmansizx2c4
authored andcommitted
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 <[email protected]>
1 parent 4cc7a7a commit c9fabbd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tun/tun_windows.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package tun
88
import (
99
"errors"
1010
"fmt"
11+
"log"
1112
"os"
1213
"sync/atomic"
1314
"time"
@@ -84,10 +85,13 @@ func CreateTUNWithRequestedGUID(ifname string, requestedGUID *windows.GUID, mtu
8485
return nil, fmt.Errorf("Error deleting already existing interface: %w", err)
8586
}
8687
}
87-
wt, _, err = WintunPool.CreateAdapter(ifname, requestedGUID)
88+
wt, rebootRequired, err := WintunPool.CreateAdapter(ifname, requestedGUID)
8889
if err != nil {
8990
return nil, fmt.Errorf("Error creating interface: %w", err)
9091
}
92+
if rebootRequired {
93+
log.Println("Windows indicated a reboot is required.")
94+
}
9195

9296
forcedMTU := 1420
9397
if mtu > 0 {

0 commit comments

Comments
 (0)