<!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>I actually really want to include the patch, the problem
of rpcapd depending on pcap-int.h has been a pet peeve for me too on windows for
the same exact problem you had (different definitions of pcap_t causing crashes
in rpcapd.exe). And it looks like the only thing that needs to be ironed out in
the patch that you provided is bufsize, everything else looks good. Config.h is
not available on the win32 build, so it's not an option.</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>I will look more into how to solve the issue, maybe
using a default value for bufsize instead of taking it from pcap_t or using
snaplen.</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><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri></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> Tuesday, June 22, 2010 10:09 PM</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> Re: [Winpcap-users] BUG rpcapd - inproper internal
structurepcap_tusage</DIV></DIV></DIV>
<DIV><BR></DIV>Hi
<DIV>Another way would be only include config.h as first include in
daemon.c.</DIV>
<DIV>I have used the more complicated way because i would like to see</DIV>
<DIV> rpcapd independent of internal libpcap structures.</DIV>
<DIV><BR></DIV>
<DIV>You are right, that it may affect TCP performance.</DIV>
<DIV>If you don't mind about dependency on pcap.</DIV>
<DIV>You can only include config.h and drop other changes. in this patch.</DIV>
<DIV><BR></DIV>
<DIV>MOJE</DIV>
<DIV><BR>
<DIV class=gmail_quote>2010/6/22 Gianluca Varenni <SPAN dir=ltr><<A
title="mailto:gianluca.varenni@cacetech.com CTRL + Click to follow link"
href="mailto:gianluca.varenni@cacetech.com">gianluca.varenni@cacetech.com</A>></SPAN><BR>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>
<DIV style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px"
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><B>From:</B> <A title=Tomas.Konir@liberouter.org
href="mailto:Tomas.Konir@liberouter.org" target=_blank>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"
target=_blank>winpcap-users@winpcap.org</A> </DIV>
<DIV><B>Subject:</B> [Winpcap-users] BUG rpcapd - inproper internal structure
pcap_tusage</DIV></DIV></DIV>
<DIV>
<DIV></DIV>
<DIV class=h5>
<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"
target=_blank>Tomas.Konir@gmail.com</A><BR></DIV></DIV></DIV>
<P></P>
<HR>
<P></P>_______________________________________________<BR>Winpcap-users
mailing list<BR><A href="mailto:Winpcap-users@winpcap.org"
target=_blank>Winpcap-users@winpcap.org</A><BR><A
href="https://www.winpcap.org/mailman/listinfo/winpcap-users"
target=_blank>https://www.winpcap.org/mailman/listinfo/winpcap-users</A><BR>
<P></P></DIV><BR>_______________________________________________<BR>Winpcap-users
mailing list<BR><A
href="mailto:Winpcap-users@winpcap.org">Winpcap-users@winpcap.org</A><BR><A
href="https://www.winpcap.org/mailman/listinfo/winpcap-users"
target=_blank>https://www.winpcap.org/mailman/listinfo/winpcap-users</A><BR><BR></BLOCKQUOTE></DIV><BR><BR
clear=all><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>