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 href="mailto:gianluca.varenni@cacetech.com">gianluca.varenni@cacetech.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<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>