tcpdump mailing list archives

Re: Output goes weird!


From: "" <csmjmr () bath ac uk>
Date: Fri, 12 Sep 2003 10:11:40 +0100

Hi


The non-printable characters problem is fixed.
I fixed it by setting the snaplen to 2048.

That's not a fix, that just hides the problem - your program should, 
for safety's sake, check the "caplen" field of the pcap_pkthdr 
structure, and not look at any bytes past that length.  (Yes, if you're 
capturing on a network where packets are never > 2048 bytes, you 
*should* be safe - but, just in case the packet is somehow malformed, 
you should *still* do that check.)


I see - Ok... I will add this check (or at least write about it :o))

The packet dropping is a separate problem.
I used TCPDUMP to tell me wether packets were being dropped...
at the end where it gives number received and number dropped by kernel.


Are you using a packet filter expression when capturing?  I.e., does 
your program do a "pcap_compile()" and a "pcap_setfilter()"?


Yes I'm applying a filter with pcap_compile() and then pcap_setfilter(). 

Justin
-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:tcpdump-workers-request () tcpdump org?body=unsubscribe


Current thread: