From: Bert Hubert Date: Sat, 29 Mar 2008 13:46:59 +0000 (+0000) Subject: make dnsreplay and other pcap based tools work on systems with 64 bit gettimeofday X-Git-Tag: rec-3.1.7.1~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1e7d16d4a294f42bd14bde0d65281c125bcfd03;p=thirdparty%2Fpdns.git make dnsreplay and other pcap based tools work on systems with 64 bit gettimeofday git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1175 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/dnspcap.hh b/pdns/dnspcap.hh index 7440f9b295..9594700d2f 100644 --- a/pdns/dnspcap.hh +++ b/pdns/dnspcap.hh @@ -26,8 +26,14 @@ struct pdns_pcap_file_header { }; +struct pdns_timeval +{ + uint32_t tv_sec; + uint32_t tv_usec; +}; + struct pdns_pcap_pkthdr { - struct timeval ts; /* time stamp */ + struct pdns_timeval ts; /* time stamp */ uint32_t caplen; /* length of portion present */ uint32_t len; /* length this packet (off wire) */ }; diff --git a/pdns/dnsreplay.cc b/pdns/dnsreplay.cc index 6791b36974..e0c06a1d4d 100644 --- a/pdns/dnsreplay.cc +++ b/pdns/dnsreplay.cc @@ -397,7 +397,7 @@ void pruneQids() gettimeofday(&now, 0); for(qids_t::iterator i=qids.begin(); i!=qids.end(); ) { - if(DiffTime(i->d_resentTime, now) < 60) + if(DiffTime(i->d_resentTime, now) < 10) ++i; else { s_idmanager.releaseID(i->d_assignedID); @@ -458,8 +458,6 @@ Orig 9 21 29 36 47 57 66 72 cerr<<(datafmt % "Orig" % s_questions % origWaitingFor % s_orignever % s_origanswers % 0 % s_origtimedout % 0 % 0); cerr<<(datafmt % "Refer." % s_questions % weWaitingFor % s_wenever % s_weanswers % 0 % s_wetimedout % 0 % 0); - - cerr< packetLimit) break; - mental_time=pr.d_pheader.ts; + mental_time=packet_ts; struct timeval then, now; gettimeofday(&then,0);