diff --git a/capture/capture.go b/capture/capture.go index 9190ce6..c9dfec8 100644 --- a/capture/capture.go +++ b/capture/capture.go @@ -598,12 +598,27 @@ func (l *Listener) setInterfaces() (err error) { return } + if runtime.GOOS != "windows" { + if len(pi.Addresses) == 0 { + continue + } + + if ni.Flags&net.FlagUp == 0 { + continue + } + } + l.Interfaces = append(l.Interfaces, pi) } return } func isDevice(addr string, ifi pcap.Interface) bool { + // Windows npcap loopback have no IPs + if addr == "127.0.0.1" && ifi.Name == `\Device\NPF_Loopback` { + return true + } + if addr == ifi.Name { return true }