Skip to content

Commit

Permalink
monitor: Do not select disconnected interface
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Sep 14, 2024
1 parent 5d44041 commit 2f82002
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion monitor_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 2f82002

Please sign in to comment.