[Winpcap-users] pcap_sendpacket sends only 4 bytes...!

Valpondi Hereza, Fabio fabio.valpondi_hereza at siemens.com
Thu Feb 25 02:39:39 PST 2010


Hi,

I am programming a kind of bridge device, reading from one interface, and forwarding the frame through another interface. Also in the inverse way.
The frame capture using "pcap_loop" happens without problems (I print the frame contents as well as length for debugging purposes).

The problem is when I try to send the interface via the other interface. I use the following call for the pcap_sendpacket function:
pcap_sendpacket(iface2, pkt_data_iface1_2,sizeof(pkt_data_iface1_2));

iface2 is the outgoing interface
pkt_data_iface1_2 is the frame received on Interface 1 and being sent over Interface 2
sizeof(pkt_data_iface1_2) is the buffer size.

Only the first four bytes of the frame are sent. The device that uses wireshark to analyze the frames sent by my program, shows them as malformed.
I also tried for the size parameter sizeof(hear_iface1_2->caplen) or the pcap_inject function:  The result was the same.

My question is: does anybody know, why only the first four bytes are sent?


Thanks a lot for your help!

Best regards,
Fabio Valpondi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20100225/55db9ec4/attachment.htm 


More information about the Winpcap-users mailing list