[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Pandora] CONFIG_PACKET_MMAP and initial drops
From: |
uaca |
Subject: |
Re: [Pandora] CONFIG_PACKET_MMAP and initial drops |
Date: |
Sun, 5 Jan 2003 15:32:51 +0100 |
User-agent: |
Mutt/1.3.28i |
On Sun, Jan 05, 2003 at 03:09:35PM +0100, Simon Patarin wrote:
Hi!
> Please, make a patch! I'll be happy to apply it :)
Here it is (and tested)
Ulisses
--- pcap-linux.c.orig Sun Jan 5 15:29:15 2003
+++ pcap-linux.c Sun Jan 5 15:35:06 2003
@@ -259,7 +259,7 @@
{
int k = 3;
int frames_per_block, blocks, ct, size;
-
+ struct pcap_stat stat;
struct tpacket_req req;
int pagesz = getpagesize();
@@ -324,6 +324,16 @@
//fprintf(stderr, "packet_tring_setup: %dx%d\n", ct, framesz);
+ /* We reset pcap_stats counters, because there were drops before
setting up
+ * the PACKET_RX_RING
+ */
+
+ if (pcap_stats(p, &stat) < 0) {
+ fprintf(stderr, "initially resetting pcap_stats: %s\n",
pcap_geterr(p));
+ return;
+ }
+
+
return 0;
}
#else