net.Interfaces() and friends return incompatible .Name property for pcap use in Windows
- Dominant language
- Go
- Stars
- 6.8k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Original bug report was that the Interface structs that net.Interfaces(), net.InterfaceByName(), and net.InterfaceByIndex() return doesn't contain a value usable with pcap/npcap on Windows.
On my box net.InterfaceByIndex(5), for example returns a Interface.Name "Ethernet" and what I need for pcap.OpenLive() is "\\Device\\NPF_{13044533-0543-4AF5-9E3C-85EBBC7C04BB}"
The problem seems to exist in go/interface_windows.go so it doesn't belong here.
If the expectation is for the example/arpscan.go to run in Windows, this may be considered a bug because it won't. Otherwise, feel free to delete this.
If anyone knows how to get the proper device name at runtime on Windows, outside of internal/syscall/windows, I would appreciate it. It would be really helpful to be able to get it the same way we do on a Linux box with the net package.
Contributor guide
Assessment
This issue has not been assessed yet.