tcpdump mailing list archives
Re: any device doesn't work anymore
From: Guy Harris <guy () alum mit edu>
Date: Wed, 19 Nov 2008 11:27:10 -0800
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.
Current thread:
- any device doesn't work anymore Giovanni Venturi (Nov 17)
- Re: any device doesn't work anymore Tyson Key (Nov 17)
- Re: any device doesn't work anymore Guy Harris (Nov 19)
- Re: any device doesn't work anymore Giovanni Venturi (Nov 19)
- Re: any device doesn't work anymore Guy Harris (Nov 19)
- Re: any device doesn't work anymore Giovanni Venturi (Nov 19)
- Re: any device doesn't work anymore Guy Harris (Nov 20)
- Re: any device doesn't work anymore Giovanni Venturi (Nov 19)
