On Nov 19, 2008, at 9:43 AM, Giovanni Venturi wrote:
Alle mercoledì 19 novembre 2008, Guy Harris ha scritto:
I've checked a fix for this into the main and 1.0 CVS branches.
Mmm. If you can... Can you send me a patch against 1.0.0 version?
I've attached it to this message.
Yes my program is bugged if I don't check the -1 in return . :)
I'm not perfect at all.
When you have time can you give a look at the code here:
http://websvn.kde.org/trunk/playground/network/ksniffer/ksniff/ksniff.cpp?revision=886279&view=markup
?
After
#ifdef HAVE_PCAP_GET_SELECTABLE_FD
m_pcap_fd = pcap_get_selectable_fd(m_pcapfp);
#else
m_pcap_fd = pcap_fileno(m_pcapfp);
#endif
you should do something such as
if (m_pcap_fd == -1)
{
cerr << APPNAME << "Error getting selectable FD: " <<
pcap_geterr(m_pcapfp) << endl
fflush(stderr);
return;
}
In addition, after calling pcap_next_ex(), you shouldn't check whether
p is NULL - you should check whether result is 0.
Thank you for libpcap :) .
Well, "you" here includes a lot of people; see the CREDITS file in the
libpcap source. At the end are the original developers and former
maintainers (*requiescat in pacem*, Itojun); at the top are the
current "core team", followed by everybody who's contributed one or
more patches.
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.