jaypipes / ghw

Go HardWare discovery/inspection library
Apache License 2.0
1.62k stars 174 forks source link

NIC on Windows has IsVirtual always set to false #291

Closed lukashartl closed 2 years ago

lukashartl commented 2 years ago

On Windows all NICs have IsVirtual set to false, as seen on these lines of code:

https://github.com/jaypipes/ghw/blob/b1b38be8a0b23a04caf8debe02fa6a0599bc5908/pkg/net/net_windows.go#L44-L49

The data is obtained via the following WMI Query:

https://github.com/jaypipes/ghw/blob/b1b38be8a0b23a04caf8debe02fa6a0599bc5908/pkg/net/net_windows.go#L14

Win32_NetworkAdapter has an attribute called PhysicalAdapter.

How about using this attribute instead?

I'm also willing to make a PR for that, if you approve :smile:

jaypipes commented 2 years ago

@lukashartl nice catch! yes, feel free to push up a PR and I will review ASAP! :)