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>
This commit is contained in:
parent
4cc7a7a455
commit
c9fabbd5bf
@ -8,6 +8,7 @@ package tun
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
@ -84,10 +85,13 @@ func CreateTUNWithRequestedGUID(ifname string, requestedGUID *windows.GUID, mtu
|
|||||||
return nil, fmt.Errorf("Error deleting already existing interface: %w", err)
|
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 {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("Error creating interface: %w", err)
|
return nil, fmt.Errorf("Error creating interface: %w", err)
|
||||||
}
|
}
|
||||||
|
if rebootRequired {
|
||||||
|
log.Println("Windows indicated a reboot is required.")
|
||||||
|
}
|
||||||
|
|
||||||
forcedMTU := 1420
|
forcedMTU := 1420
|
||||||
if mtu > 0 {
|
if mtu > 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user