aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-06-14 12:34:10 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-06-14 12:34:10 +0200
commit074f1b9dcd2c2518cffdcc77cb486b6523b6a591 (patch)
treed12aa81ddda17fd04a6bdf5ca3ad2c59999662b1
parentconf: check for file not found in addition to path (diff)
downloadwireguard-windows-074f1b9dcd2c2518cffdcc77cb486b6523b6a591.tar.xz
wireguard-windows-074f1b9dcd2c2518cffdcc77cb486b6523b6a591.zip
conf: dnsresolver: try harder at bootup
-rw-r--r--conf/dnsresolver_windows.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/conf/dnsresolver_windows.go b/conf/dnsresolver_windows.go
index 08dc3783..d6c2f1c7 100644
--- a/conf/dnsresolver_windows.go
+++ b/conf/dnsresolver_windows.go
@@ -19,8 +19,11 @@ import (
//sys internetGetConnectedState(flags *uint32, reserved uint32) (connected bool) = wininet.InternetGetConnectedState
func resolveHostname(name string) (resolvedIPString string, err error) {
- const maxTries = 10
+ maxTries := 10
systemJustBooted := windows.DurationSinceBoot() <= time.Minute*4
+ if systemJustBooted {
+ maxTries *= 4
+ }
for i := 0; i < maxTries; i++ {
resolvedIPString, err = resolveHostnameOnce(name)
if err == nil {