Skip to content

Fix examples/arp_packet.rs#586

Merged
mrmonday merged 1 commit intolibpnet:masterfrom
palindrom615:patch-1
Feb 3, 2023
Merged

Fix examples/arp_packet.rs#586
mrmonday merged 1 commit intolibpnet:masterfrom
palindrom615:patch-1

Conversation

@palindrom615
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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.

3 participants