aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tunnel
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-10-01 14:13:40 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-10-01 14:13:40 +0200
commitcf6f599a4a65e89929ffc12982346c8e9012552c (patch)
treecf91c4df338b3924252641da4117751627f1c22b /tunnel
parenttunnel: smooth bursts from windows network notifiers (diff)
downloadwireguard-windows-cf6f599a4a65e89929ffc12982346c8e9012552c.tar.xz
wireguard-windows-cf6f599a4a65e89929ffc12982346c8e9012552c.zip
tunnel: check for endpoint interfaces and media connection state
Diffstat (limited to 'tunnel')
-rw-r--r--tunnel/defaultroutemonitor.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/tunnel/defaultroutemonitor.go b/tunnel/defaultroutemonitor.go
index 2d63e5db..c3d11789 100644
--- a/tunnel/defaultroutemonitor.go
+++ b/tunnel/defaultroutemonitor.go
@@ -30,7 +30,9 @@ func bindSocketRoute(family winipcfg.AddressFamily, device *device.Device, ourLU
continue
}
ifrow, err := r[i].InterfaceLUID.Interface()
- if err != nil || ifrow.OperStatus != winipcfg.IfOperStatusUp {
+ if err != nil || ifrow.OperStatus != winipcfg.IfOperStatusUp ||
+ ifrow.InterfaceAndOperStatusFlags & winipcfg.IAOSFNotMediaConnected != 0 ||
+ ifrow.InterfaceAndOperStatusFlags & winipcfg.IAOSFEndPointInterface != 0 {
continue
}
if r[i].Metric < lowestMetric {