exported / execap

Automatically exported from code.google.com/p/execap
GNU General Public License v3.0
0 stars 0 forks source link

libpcap stats suffer 32bit integer wrap #18

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
libpcap maintains stats with u_int types which are 32bit (even on x86_64):

struct pcap_stat {
   u_int ps_recv;      
   u_int ps_drop;      
   u_int ps_ifdrop;    
#ifdef WIN32
   u_int bs_capt;      
#endif /* WIN32 */
};

$ cat test.c
#include <stdio.h>
#include <stdlib.h>
#include <pcap.h>

int main(void) {

  printf("Size of u_int: %lu\n", sizeof(u_int));

  return 0;
}

$ ./test 
Size of u_int: 4

I ask the pcap dev list about this.

Original issue reported on code.google.com by bmenr...@ucsd.edu on 6 Jan 2011 at 11:19

GoogleCodeExporter commented 9 years ago

Original comment by bmenr...@ucsd.edu on 17 Feb 2011 at 5:09