Skip to content
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

Fix examples/arp_packet.rs #586

Merged
merged 1 commit into from Feb 3, 2023
Merged

Conversation

palindrom615
Copy link
Contributor

IIUC, the goal of this code is to look up MAC address matching target_ip, by receiving ARP packet from the target host sends.

If so, catching subsequent packet won't work because the very next received packet is the ARP request just sent by the function itself. (at least on my macbook)

To make this work, IMO, lookup every packets while reply packet found.

Instead of returning the next received arp packet, wait for receiving arp packet from the target.
@zszep
Copy link

zszep commented Feb 3, 2023

Your fix made the example run as expected. Got almost a headache wondering why the mac of my NIC was returned and not of the remote host. This should be merged into the main branch ASAP.

@mrmonday
Copy link
Contributor

mrmonday commented Feb 3, 2023

Thanks!

@mrmonday mrmonday merged commit c9d7c1c into libpnet:master Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants