Need help with injecting raw ethernet frames using TAP interface
Hi all, I have UDP packets generated on Machine A that are addressed to Machine B (unicast) that I capture with PCAP. After transporting this raw data to Machine B (via RF modem) I'm trying to reinject the original UDP on Machine B through a tap0 interface. The capture and transport are all working fine. BUT once on the destination machine, the reinjected ethernet packets are NOT being received by a local UDP server. this is my socket creation (removed error checking for brevity) :
Code:
outputSocket = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); Code:
int bytesSent = 0; after the call to write() completes, Wireshark on Machine B sees a correctly formatted (checksums and all) UDP packet when listening to tap0 - ie. no lines highlighted in red. *BUT* - a UDP server i have running on Machine B never receives the reinjected UDP datagram. (I have verified that this server works, by using a simple local udp generator app.) is there something wrong with how I'm creating the socket and/or writing the data back out to the tap0? Thanks in advance! Keith |
You have it backwards - you should not be using a socket. Read the tutorial at: http://backreference.org/2010/03/26/...face-tutorial/
|
All times are GMT -5. The time now is 04:38 PM. |