[Winpcap-users] pcap_sendpacket to local adaptor (Sending to the local machine)

Kyle Brotheridge kyle at connecttel.com.au
Wed May 19 09:52:01 PDT 2010


Part of the little project I'm writing involves ARP replying on behalf of a host that doesn't exist on the local network - but I cannot get it to work!

To elaborate a bit more; an example:

My program, using WinPCAP is running on host A, bound to interface X (With the MAC address AA:AA:AA:AA:AA:AA), my program (pcap) captures an ARP request (generated by the OS) from the local PC (AA:AA:AA:AA:AA:AA), looking for Host "B" at 10.10.10.3

My program processes this, and assembles an ARP reply from "10.10.10.3" with the MAC address of BB:BB:BB:BB:BB:BB (The virtual host B) and sends it via pcap_sendpacket to the MAC address of AA:AA:AA:AA:AA:AA (The local PC).

Windows doesn't register the reply (there's no arp entry in arp -a for 10.10.10.3).

Now I've tested this with another local machine (Let's say Host C, looking for Host "B" at 10.10.10.3) broadcasting an ARP request to my Host A, then my program replies as Host B via pcap_sendpacket.

Host C receives a valid ARP packet and the table is updated (And proven via wireshark and arp -a on host C).

I'm running the WinPCAP 4.1.1 SDK x86, Windows 7 x64.

I've considered that if I was to send to the local PC, then the CRC + Padding done by the NIC might not happen and the kernel mode driver would drop the frame... But I'm still not sure.


Does anyone have any ideas as to why this is being a pain to get working?




More information about the Winpcap-users mailing list