-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to associate pcap.Interface with net.Interface? #456
Comments
Looking at source code of pcap.go, I saw that Handle has an unexported deviceIndex field. Can we export it but keep it read-only? (i.e. a method on *Handle which returns deviceIndex) @gconnell any thoughts? |
I think just changing it deviceIndex -> DeviceIndex should be fine. Hopefully it actually matches with the net.Interface indexes :-/ |
It doesn't. At least not on Windows. I believe, it will never match on Windows with current code. That is because net.Interface refers to network connections and pcap.Interface refers to NIC. Their names are always different and current code tries to match them based on name. I will test on Linux to get a complete picture, and then we will see how we can solve this. |
Awesome, thanks for looking into this!
…On Mon, May 28, 2018 at 12:20 AM, Irfan Abid ***@***.***> wrote:
It doesn't. At least not on Windows. I believe, it will never match on
Windows with current code. That is because net.Interface refers to network
connections and pcap.Interface refers to NIC. Their names are always
different and current code tries to match them based on name.
I will test on Linux to get a complete picture, and then we will see how
we can solve this.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#456 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABJ9tsEfx1MZGQLcRLx4CiF_WyU22GAfks5t25dIgaJpZM4UGBUa>
.
|
use pcap.FindAllDevs() can get the name which contains "Device\NPF_" |
The bug is about deviceIndex rather than name. |
Any updates to this? Having the same issue with Windows devices. |
I had the same problem. I solved it by matching the IP addresses of the interfaces with those of the devices. It is certainly not the most elegant solution, but it works. Here is an implementation of this solution in the arpscan.go: |
Facing same problem here i think window have not properly handled it |
Hi,
As mentioned in subject, I am trying to figure out which pcap.Interface represents which net.Interface
As I understand pcap.Interface is actually a hardware device, while net.Interface is a network connection (ie. a logical construct in Windows to control hardware device).
Is the only way to associate them together using IP Address? (suprisingly, pcap.Interface doesn't expose Hardware Address field)
I am looking for a better way to associate them together. Perhaps based on interface index? (couldn't find it in pcap.Interface)
The text was updated successfully, but these errors were encountered: