monitor: Do not select disconnected interface

This commit is contained in:
世界 2024-09-14 09:26:38 +08:00
parent 9939b78c88
commit 7e1f286063
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -78,12 +78,16 @@ func (m *defaultInterfaceMonitor) checkUpdate() error {
continue
}
if ifrow.Type == winipcfg.IfTypePropVirtual || ifrow.Type == winipcfg.IfTypeSoftwareLoopback {
continue
}
iface, err := row.InterfaceLUID.IPInterface(windows.AF_INET)
if err != nil {
continue
}
if ifrow.Type == winipcfg.IfTypePropVirtual || ifrow.Type == winipcfg.IfTypeSoftwareLoopback {
if !iface.Connected {
continue
}