From: Peter van Dijk Date: Mon, 1 Jul 2013 14:04:16 +0000 (+0200) Subject: fix compiler warnings, thanks Morten Stevens X-Git-Tag: rec-3.6.0-rc1~605 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fa0c611ebab07a1244c7aef6dbd97ee8a7ed1452;p=pdns fix compiler warnings, thanks Morten Stevens --- diff --git a/pdns/dnsbulktest.cc b/pdns/dnsbulktest.cc index d826ae365..527f9807a 100644 --- a/pdns/dnsbulktest.cc +++ b/pdns/dnsbulktest.cc @@ -295,7 +295,6 @@ int main(int argc, char** argv) cerr<<"\n"; cerr<< "Mean response time: "< >::iterator > histogram_type; boost::format statfmt("Time < %6.03f msec %|30t|%6.03f%% cumulative\n"); diff --git a/pdns/dnspcap.hh b/pdns/dnspcap.hh index 1142ce3b9..1e6a1143c 100644 --- a/pdns/dnspcap.hh +++ b/pdns/dnspcap.hh @@ -87,7 +87,7 @@ public: const struct tcphdr *d_tcp; const struct udphdr *d_udp; const uint8_t* d_payload; - int d_len; + unsigned int d_len; struct pdns_pcap_pkthdr d_pheader; pdns_pcap_file_header d_pfh; diff --git a/pdns/dnsscan.cc b/pdns/dnsscan.cc index e4dd608fa..27cb24469 100644 --- a/pdns/dnsscan.cc +++ b/pdns/dnsscan.cc @@ -51,7 +51,7 @@ try if(mdp.d_qtype < 256) counts[mdp.d_qtype]++; - for(int i=0; i < mdp.d_qname.length(); ++i) + for(unsigned int i=0; i < mdp.d_qname.length(); ++i) if(!isalnum(mdp.d_qname[i]) && mdp.d_qname[i]!='.' && mdp.d_qname[i]!='-' && mdp.d_qname[i]!='_') { // cout<uh_dport)==53 || ntohs(pr.d_udp->uh_sport)==53 && pr.d_len > sizeof(dnsheader)) { + if(ntohs(pr.d_udp->uh_dport)==53 || (ntohs(pr.d_udp->uh_sport)==53 && pr.d_len > sizeof(dnsheader))) { dnsheader* dh=(dnsheader*)pr.d_payload; uint32_t *src=(uint32_t*)&pr.d_ip->ip_src;