aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--service/ifaceconfig.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/service/ifaceconfig.go b/service/ifaceconfig.go
index fe57873b..87afe90c 100644
--- a/service/ifaceconfig.go
+++ b/service/ifaceconfig.go
@@ -33,6 +33,11 @@ func bindSocketRoute(family winipcfg.AddressFamily, device *device.Device, ourLu
if route.DestinationPrefix.PrefixLength != 0 || route.InterfaceLuid == ourLuid {
continue
}
+ ifrow, err := winipcfg.GetIfRow(route.InterfaceLuid, winipcfg.MibIfEntryNormalWithoutStatistics)
+ if err != nil || ifrow.OperStatus != winipcfg.IfOperStatusUp {
+ log.Printf("Found default route for interface %d, but not up, so skipping", route.InterfaceIndex)
+ continue
+ }
if route.Metric < lowestMetric {
lowestMetric = route.Metric
index = route.InterfaceIndex