<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.5921" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Verdana size=2><SPAN
class=925433010-25022010>Hi,</SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN
class=925433010-25022010></SPAN></FONT> </DIV>
<DIV><FONT face=Verdana size=2><SPAN class=925433010-25022010>I am programming a
kind of bridge device, reading from one interface, and forwarding the frame
through another interface. Also in the inverse way.</SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN class=925433010-25022010>The frame capture
using "pcap_loop" happens without problems (I print the frame contents as well
as length for debugging purposes).</SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN
class=925433010-25022010></SPAN></FONT> </DIV>
<DIV><FONT face=Verdana size=2><SPAN class=925433010-25022010>The problem is
when I try to send the interface via the other interface. I use the following
call for the pcap_sendpacket function:</SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN
class=925433010-25022010><STRONG>pcap_sendpacket(iface2,
pkt_data_iface1_2,sizeof(pkt_data_iface1_2));</STRONG></SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN
class=925433010-25022010></SPAN></FONT> </DIV>
<DIV><FONT face=Verdana size=2><SPAN class=925433010-25022010><EM>iface2</EM> is
the outgoing interface</SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN
class=925433010-25022010><EM>pkt_data_iface1_2</EM> is the frame received on
Interface 1 and being sent over Interface 2</SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN
class=925433010-25022010><EM>sizeof(pkt_data_iface1_2)</EM> is the buffer
size.</SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN
class=925433010-25022010></SPAN></FONT> </DIV>
<DIV><FONT face=Verdana size=2><SPAN class=925433010-25022010><SPAN
class=925433010-25022010>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.</SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN class=925433010-25022010>I also tried for
the size parameter <EM>sizeof(hear_iface1_2->caplen)</EM> or the
<STRONG>pcap_inject</STRONG> function: <U><STRONG>The result was the
same.</STRONG></U></SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN
class=925433010-25022010></SPAN></FONT> </DIV>
<DIV><FONT face=Verdana size=2><SPAN class=925433010-25022010>My question is:
does anybody know, why only the first four bytes are sent?</SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN
class=925433010-25022010></SPAN></FONT> </DIV>
<DIV><FONT face=Verdana size=2><SPAN
class=925433010-25022010></SPAN></FONT> </DIV>
<DIV><FONT face=Verdana size=2><SPAN class=925433010-25022010>Thanks a lot for
your help!</SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN
class=925433010-25022010></SPAN></FONT> </DIV>
<DIV><FONT face=Verdana size=2><SPAN class=925433010-25022010>Best
regards,</SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN class=925433010-25022010>Fabio
Valpondi</SPAN></FONT></DIV></BODY></HTML>