From baf3144134b5c3d1a89d41552ecc7c461ffb0ebc Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 1 Oct 2019 14:13:40 +0200 Subject: tunnel: check for endpoint interfaces and media connection state Signed-off-by: Jason A. Donenfeld --- tunnel/defaultroutemonitor.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tunnel') 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 { -- cgit v1.2.3-59-g8ed1b