<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=text/html;charset=utf-8 http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.7600.16588"></HEAD>
<BODY style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px"
id=MailContainerBody leftMargin=0 topMargin=0 CanvasTabStop="true"
name="Compose message area">
<DIV><FONT face=Calibri>Tomas,</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>I'm working on applying your patches to our codebase.
I'm not completely sure about changing bufsize to snaplen. First of all, I think
that </FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>- startcapreply->bufsize=
htonl(fp->bufsize);<BR>+ //startcapreply->bufsize=
htonl(fp->bufsize);<BR>+ startcapreply->bufsize=
startcapreq.snaplen;<BR></FONT></DIV>
<DIV><FONT face=Calibri>should actually read</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>+ startcapreply->bufsize=
htonl(startcapreq.snaplen);<BR></FONT></DIV>
<DIV><FONT face=Calibri>Then if bufsize is snaplen, I think that the TCP
performance would be affected (it looks like bufsize is used to set SO_RCVBUF of
the socket itself).</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>Have a nice day</FONT></DIV>
<DIV><FONT face=Calibri>GV</FONT></DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><BR></DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=Tomas.Konir@liberouter.org
href="mailto:Tomas.Konir@liberouter.org">Tomas Konir</A> </DIV>
<DIV><B>Sent:</B> Wednesday, April 28, 2010 2:31 AM</DIV>
<DIV><B>To:</B> <A title=winpcap-users@winpcap.org
href="mailto:winpcap-users@winpcap.org">winpcap-users@winpcap.org</A> </DIV>
<DIV><B>Subject:</B> [Winpcap-users] BUG rpcapd - inproper internal structure
pcap_tusage</DIV></DIV></DIV>
<DIV><BR></DIV>rpcapd use pcap-int.h and than directly pcap_t structure.
<DIV>size of pcap_t and position of individual fields is not independent</DIV>
<DIV>and depends on config.h generated by configure.</DIV>
<DIV>The result is rewritten memory and bugs like: socket error, invalid socket,
SIGSEGV and similar.</DIV>
<DIV><BR></DIV>
<DIV>I tried to remove usage of internal pcap_t structure and use rpcapd
owns.</DIV>
<DIV><BR></DIV>
<DIV>Patch is attached, and i have two notes.</DIV>
<DIV><BR></DIV>
<DIV>1. timezone is set to zero (but no code in libpcap/winpcap use it)</DIV>
<DIV>2. bufsize is set to snaplen instead of internal pcap_t->bufsize.</DIV>
<DIV><BR></DIV>
<DIV>MOJE</DIV>
<DIV><BR></DIV>
<DIV>P.S. another way would by use config.h from libpcap, but i don't prefer
it.</DIV>
<DIV> </DIV>
<DIV><BR>-- <BR>Tomas Konir<BR>Prague<BR>Czech Republic<BR>ICQ:
25849167<BR>Jabber: <A
href="mailto:Tomas.Konir@gmail.com">Tomas.Konir@gmail.com</A><BR></DIV>
<P>
<HR>
<P></P>_______________________________________________<BR>Winpcap-users mailing
list<BR>Winpcap-users@winpcap.org<BR>https://www.winpcap.org/mailman/listinfo/winpcap-users<BR></BODY></HTML>