File pdns-2.9.21.1_gcc43.patch of Package pdns
Index: pdns/misc.hh
===================================================================
--- pdns/misc.hh.orig 2007-04-21 15:56:36.000000000 +0200
+++ pdns/misc.hh 2007-10-19 14:16:05.199446032 +0200
@@ -19,6 +19,7 @@
#ifndef MISC_HH
#define MISC_HH
#include <stdint.h>
+#include <cstring>
#if 0
#define RDTSC(qp) \
@@ -234,7 +235,7 @@ inline bool dns_isspace(char c)
return c==' ' || c=='\t' || c=='\r' || c=='\n';
}
-inline const char dns_tolower(char c)
+inline char dns_tolower(char c)
{
if(c>='A' && c<='Z')
c+='a'-'A';
Index: modules/ldapbackend/powerldap.cc
===================================================================
--- modules/ldapbackend/powerldap.cc.orig 2007-04-21 15:56:36.000000000 +0200
+++ modules/ldapbackend/powerldap.cc 2007-10-19 14:20:35.715676993 +0200
@@ -1,5 +1,6 @@
#include "powerldap.hh"
-
+// for timeval
+#include <sys/time.h>
PowerLDAP::PowerLDAP( const string& hosts, uint16_t port, bool tls )
Index: pdns/dynmessenger.cc
===================================================================
--- pdns/dynmessenger.cc.orig 2007-04-21 15:56:36.000000000 +0200
+++ pdns/dynmessenger.cc 2007-10-19 14:25:46.450315300 +0200
@@ -18,6 +18,7 @@
*/
#include "dynmessenger.hh"
#include <cstdio>
+#include <cstdlib>
#include <cstring>
#include <cerrno>
#include <iostream>
Index: pdns/dns.hh
===================================================================
--- pdns/dns.hh.orig 2007-10-28 18:06:29.770749557 +0100
+++ pdns/dns.hh 2007-10-28 18:07:03.476772361 +0100
@@ -115,7 +115,7 @@ struct EDNS0Record
#pragma pack (pop)
#endif
-typedef enum {
+enum {
ns_t_invalid = 0, /* Cookie. */
ns_t_a = 1, /* Host address. */
ns_t_ns = 2, /* Authoritative server. */
@@ -137,7 +137,7 @@ typedef enum {
ns_t_afsdb = 18, /* AFS cell database. */
ns_t_x25 = 19, /* X_25 calling address. */
ns_t_isdn = 20, /* ISDN calling address. */
- ns_t_rt = 21, /* Router. */
+ ns_t_rt = 21, /* Router. */
ns_t_nsap = 22, /* NSAP address. */
ns_t_nsap_ptr = 23, /* Reverse NSAP lookup (deprecated). */
ns_t_sig = 24, /* Security signature. */
Index: pdns/dnsparser.cc
===================================================================
--- pdns/dnsparser.cc.orig 2007-10-28 18:06:29.770749557 +0100
+++ pdns/dnsparser.cc 2007-10-28 18:07:03.480772602 +0100
@@ -205,7 +205,7 @@ void MOADNSParser::init(const char *pack
struct dnsrecordheader ah;
vector<unsigned char> record;
validPacket=true;
- for(n=0;n < d_header.ancount + d_header.nscount + d_header.arcount; ++n) {
+ for(n=0;n < (unsigned)(d_header.ancount + d_header.nscount + d_header.arcount); ++n) {
DNSRecord dr;
if(n < d_header.ancount)
Index: pdns/pdns_recursor.cc
===================================================================
--- pdns/pdns_recursor.cc.orig 2007-10-28 18:06:29.770749557 +0100
+++ pdns/pdns_recursor.cc 2007-10-28 18:07:03.500773802 +0100
@@ -412,7 +412,7 @@ void primeHints(void)
set<DNSResourceRecord>nsset;
if(::arg()["hint-file"].empty()) {
- static char*ips[]={"198.41.0.4", "192.228.79.201", "192.33.4.12", "128.8.10.90", "192.203.230.10", "192.5.5.241", "192.112.36.4", "128.63.2.53",
+ static const char*ips[]={"198.41.0.4", "192.228.79.201", "192.33.4.12", "128.8.10.90", "192.203.230.10", "192.5.5.241", "192.112.36.4", "128.63.2.53",
"192.36.148.17","192.58.128.30", "193.0.14.129", "198.32.64.12", "202.12.27.33"};
DNSResourceRecord arr, nsrr;
arr.qtype=QType::A;
Index: pdns/sstuff.hh
===================================================================
--- pdns/sstuff.hh.orig 2007-10-28 18:06:29.770749557 +0100
+++ pdns/sstuff.hh 2007-10-28 18:07:03.516774762 +0100
@@ -189,12 +189,14 @@ public:
struct sockaddr_in remote;
socklen_t remlen=sizeof(remote);
int bytes;
- if((bytes=recvfrom(d_socket, d_buffer, d_buflen, 0, (sockaddr *)&remote, &remlen))<0)
- if(errno!=EAGAIN)
+ if((bytes=recvfrom(d_socket, d_buffer, d_buflen, 0, (sockaddr *)&remote, &remlen))<0) {
+ if(errno!=EAGAIN) {
throw NetworkError(strerror(errno));
- else
+ }
+ else {
return false;
-
+ };
+ };
dgram.assign(d_buffer,bytes);
ep.address.byte=remote.sin_addr.s_addr;
ep.port=ntohs(remote.sin_port);
Index: pdns/communicator.hh
===================================================================
--- pdns/communicator.hh.orig 2007-10-28 18:06:29.770749557 +0100
+++ pdns/communicator.hh 2007-10-28 18:07:03.536775962 +0100
@@ -94,7 +94,7 @@ public:
time_t earliest()
{
- time_t early=(1<<31)-1; // y2038 problem lurking here :-)
+ time_t early=numeric_limits<time_t>::max() - 1;
for(d_nqueue_t::const_iterator i=d_nqueue.begin();i!=d_nqueue.end();++i)
early=min(early,i->next);
return early-time(0);
Index: pdns/resolver.cc
===================================================================
--- pdns/resolver.cc.orig 2007-10-28 18:06:29.770749557 +0100
+++ pdns/resolver.cc 2007-10-28 18:07:03.552776923 +0100
@@ -397,12 +397,12 @@ Resolver::res_t Resolver::result()
if(mdp->d_header.id != d_randomid) {
throw ResolverException("Remote nameserver replied with wrong id");
}
- if(mdp->d_header.rcode)
+ if(mdp->d_header.rcode) {
if(d_inaxfr)
throw ResolverException("Remote nameserver unable/unwilling to AXFR with us: RCODE="+itoa(mdp->d_header.rcode));
else
throw ResolverException("Remote nameserver reported error: RCODE="+itoa(mdp->d_header.rcode));
-
+ }
if(!d_inaxfr) {
if(mdp->d_header.qdcount!=1)
throw ResolverException("resolver: received answer with wrong number of questions ("+itoa(mdp->d_header.qdcount)+")");
Index: pdns/packethandler.cc
===================================================================
--- pdns/packethandler.cc.orig 2007-10-28 18:06:29.770749557 +0100
+++ pdns/packethandler.cc 2007-10-28 18:07:03.584778843 +0100
@@ -66,7 +66,7 @@ PacketHandler::~PacketHandler()
void PacketHandler::addRootReferral(DNSPacket* r)
{
// nobody reads what we output, but it appears to be the magic that shuts some nameservers up
- static char*ips[]={"198.41.0.4", "192.228.79.201", "192.33.4.12", "128.8.10.90", "192.203.230.10", "192.5.5.241", "192.112.36.4", "128.63.2.53",
+ static const char*ips[]={"198.41.0.4", "192.228.79.201", "192.33.4.12", "128.8.10.90", "192.203.230.10", "192.5.5.241", "192.112.36.4", "128.63.2.53",
"192.36.148.17","192.58.128.30", "193.0.14.129", "198.32.64.12", "202.12.27.33"};
static char templ[40];
strncpy(templ,"a.root-servers.net", sizeof(templ) - 1);
Index: pdns/receiver.cc
===================================================================
--- pdns/receiver.cc.orig 2007-10-28 18:06:29.770749557 +0100
+++ pdns/receiver.cc 2007-10-28 18:07:03.604780044 +0100
@@ -66,7 +66,7 @@ time_t s_starttime;
string s_programname="pdns"; // used in packethandler.cc
-char *funnytext=
+const char *funnytext=
"*****************************************************************************\n"\
"Ok, you just ran pdns_server through 'strings' hoping to find funny messages.\n"\
"Well, you found one. \n"\
Index: pdns/distributor.hh
===================================================================
--- pdns/distributor.hh.orig 2007-04-21 15:56:36.000000000 +0200
+++ pdns/distributor.hh 2007-10-28 19:02:46.109418953 +0100
@@ -82,7 +82,6 @@ public:
struct QuestionData
{
Question *Q;
- time_t created;
void (*callback)(const AnswerData &);
int id;
};