Commit Diff
Diff:
267b2013841c63efe0e7af6ee9daab8f1680455a
c5bcfb5c9f3dc796d9d46e8acb4e8edf0155d4fb
Commit:
c5bcfb5c9f3dc796d9d46e8acb4e8edf0155d4fb
Tree:
5fc8afaaf659e86d5700d8a37118218ffa9ec4a1
Author:
pbug <pbug@delphinusdns.org>
Committer:
pbug <pbug@delphinusdns.org>
Date:
Tue Jul 27 07:19:05 2010 UTC
Message:
* remove compiler warnings by casting several functions * change memcasecmp() first and second argument to u_char * compiled on {free,net,open}bsd and linux opensuse 10.3 works ok.
blob - ab840d70e4c64c140c9b27886a6c557ddf80e280
blob + 64d3bbd40c1646183fe3c5f8e947c99598c9ea66
--- additional.c
+++ additional.c
@@ -36,7 +36,7 @@ int additional_ptr(char *, int, struct domain *, char
extern int compress_label(u_char *, int, int);
-static const char rcsid[] = "$Id: additional.c,v 1.9 2010/04/15 17:56:39 pbug Exp $";
+static const char rcsid[] = "$Id: additional.c,v 1.10 2010/07/27 07:19:05 pbug Exp $";
/*
@@ -75,7 +75,7 @@ additional_a(char *name, int namelen, struct domain *s
memcpy(&reply[offset], name, namelen);
offset += namelen;
- tmplen = compress_label(reply, offset, namelen);
+ tmplen = compress_label((u_char*)reply, offset, namelen);
if (tmplen != 0) {
offset = tmplen;
@@ -106,7 +106,7 @@ additional_a(char *name, int namelen, struct domain *s
memcpy(&reply[offset], name, namelen);
offset += namelen;
- tmplen = compress_label(reply, offset, namelen);
+ tmplen = compress_label((u_char*)reply, offset, namelen);
if (tmplen != 0) {
offset = tmplen;
@@ -171,7 +171,7 @@ additional_aaaa(char *name, int namelen, struct domain
memcpy(&reply[offset], name, namelen);
offset += namelen;
- tmplen = compress_label(reply, offset, namelen);
+ tmplen = compress_label((u_char*)reply, offset, namelen);
if (tmplen != 0) {
offset = tmplen;
@@ -204,7 +204,7 @@ additional_aaaa(char *name, int namelen, struct domain
memcpy(&reply[offset], name, namelen);
offset += namelen;
- tmplen = compress_label(reply, offset, namelen);
+ tmplen = compress_label((u_char*)reply, offset, namelen);
if (tmplen != 0) {
offset = tmplen;
@@ -272,7 +272,7 @@ additional_mx(char *name, int namelen, struct domain *
memcpy(&reply[offset], name, namelen);
offset += namelen;
- tmplen = compress_label(reply, offset, namelen);
+ tmplen = compress_label((u_char*)reply, offset, namelen);
if (tmplen != 0) {
offset = tmplen;
@@ -300,7 +300,7 @@ additional_mx(char *name, int namelen, struct domain *
memcpy((char *)&reply[offset], (char *)sd->mx[mx_count]->exchange, sd->mx[mx_count]->exchangelen);
offset += sd->mx[mx_count]->exchangelen;
- tmplen = compress_label(reply, offset, sd->mx[mx_count]->exchangelen);
+ tmplen = compress_label((u_char*)reply, offset, sd->mx[mx_count]->exchangelen);
if (tmplen != 0) {
answer->rdlength = htons((sd->mx[mx_count]->exchangelen - (offset - tmplen)) + sizeof(u_int16_t));
@@ -322,7 +322,7 @@ additional_mx(char *name, int namelen, struct domain *
memcpy(&reply[offset], name, namelen);
offset += namelen;
- tmplen = compress_label(reply, offset, namelen);
+ tmplen = compress_label((u_char*)reply, offset, namelen);
if (tmplen != 0) {
offset = tmplen;
@@ -349,7 +349,7 @@ additional_mx(char *name, int namelen, struct domain *
memcpy((char *)&reply[offset], (char *)sd->mx[mx_count]->exchange, sd->mx[mx_count]->exchangelen);
offset += sd->mx[mx_count]->exchangelen;
- tmplen = compress_label(reply, offset, sd->mx[mx_count]->exchangelen);
+ tmplen = compress_label((u_char *)reply, offset, sd->mx[mx_count]->exchangelen);
if (tmplen != 0) {
@@ -396,7 +396,7 @@ additional_ptr(char *name, int namelen, struct domain
memcpy(&reply[offset], name, namelen);
offset += namelen;
- tmplen = compress_label(reply, offset, namelen);
+ tmplen = compress_label((u_char*)reply, offset, namelen);
if (tmplen != 0) {
offset = tmplen;
@@ -423,7 +423,7 @@ additional_ptr(char *name, int namelen, struct domain
memcpy((char *)&reply[offset], (char *)sd->ptr, sd->ptrlen);
offset += sd->ptrlen;
- tmplen = compress_label(reply, offset, sd->ptrlen);
+ tmplen = compress_label((u_char*)reply, offset, sd->ptrlen);
if (tmplen != 0) {
answer->rdlength = htons(sd->ptrlen - (offset - tmplen));
blob - 9f8a7bfa8f8aae42531f1baf6bd4f71b2fd2eaf0
blob + 73088ce6ab0135ae637a718c319cb193038d54a3
--- main.c
+++ main.c
@@ -60,7 +60,7 @@ extern void init_recurse(void);
char * dns_label(char *, int *);
int compress_label(u_char *, u_int16_t, int);
-int memcasecmp(char *, char *, int);
+int memcasecmp(u_char *, u_char *, int);
char * get_dns_type(int dnstype);
void build_reply(struct sreply *reply, int so, char *buf, int len, struct question *q, struct sockaddr *sa, socklen_t slen, struct domain *sd1, struct domain *sd2, u_int8_t region, int istcp, int wildcard);
void recurseheader(struct srecurseheader *, int, struct sockaddr_storage *, struct sockaddr_storage *, int);
@@ -112,7 +112,7 @@ struct tcps {
} *tn1, *tn2, *tnp;
-static const char rcsid[] = "$Id: main.c,v 1.52 2010/05/29 08:55:29 pbug Exp $";
+static const char rcsid[] = "$Id: main.c,v 1.53 2010/07/27 07:19:05 pbug Exp $";
/*
* MAIN - set up arguments, set up database, set up sockets, call mainloop
@@ -1032,7 +1032,7 @@ out:
*/
int
-memcasecmp(char *b1, char *b2, int len)
+memcasecmp(u_char *b1, u_char *b2, int len)
{
int i;
int identical = 1;
blob - c3b5960c8cbe998c7a1c5b1c050f2dcf49141e8f
blob + 4f84b2cfbcc0a05bea5f947bf6e7a793fd04030a
--- reply.c
+++ reply.c
@@ -67,7 +67,7 @@ struct collects {
} *cn1, *cn2, *cnp;
-static const char rcsid[] = "$Id: reply.c,v 1.23 2010/04/15 17:56:39 pbug Exp $";
+static const char rcsid[] = "$Id: reply.c,v 1.24 2010/07/27 07:19:05 pbug Exp $";
/*
* REPLY_A() - replies a DNS question (*q) on socket (so)
@@ -676,7 +676,7 @@ reply_ns(struct sreply *sreply, DB *db)
outlen += (12 + namelen);
/* compress the label if possible */
- if ((tmplen = compress_label(reply, outlen, namelen)) > 0) {
+ if ((tmplen = compress_label((u_char*)reply, outlen, namelen)) > 0) {
/* XXX */
outlen = tmplen;
}
@@ -858,7 +858,7 @@ reply_cname(struct sreply *sreply)
outlen = i;
/* compress the label if possible */
- if ((tmplen = compress_label(reply, outlen, labellen)) > 0) {
+ if ((tmplen = compress_label((u_char*)reply, outlen, labellen)) > 0) {
/* XXX */
outlen = tmplen;
}
@@ -1023,7 +1023,7 @@ reply_ptr(struct sreply *sreply)
outlen = i;
/* compress the label if possible */
- if ((tmplen = compress_label(reply, outlen, labellen)) > 0) {
+ if ((tmplen = compress_label((u_char*)reply, outlen, labellen)) > 0) {
outlen = tmplen;
}
@@ -1169,7 +1169,7 @@ reply_soa(struct sreply *sreply)
outlen = i;
/* compress the label if possible */
- if ((tmplen = compress_label(reply, outlen, labellen)) > 0) {
+ if ((tmplen = compress_label((u_char*)reply, outlen, labellen)) > 0) {
outlen = tmplen;
}
@@ -1192,7 +1192,7 @@ reply_soa(struct sreply *sreply)
/* 2 compress the label if possible */
- if ((tmplen = compress_label(reply, outlen, labellen)) > 0) {
+ if ((tmplen = compress_label((u_char*)reply, outlen, labellen)) > 0) {
outlen = tmplen;
}
@@ -1588,7 +1588,7 @@ reply_nxdomain(struct sreply *sreply)
outlen = i;
/* compress the label if possible */
- if ((tmplen = compress_label(reply, outlen, labellen)) > 0) {
+ if ((tmplen = compress_label((u_char*)reply, outlen, labellen)) > 0) {
outlen = tmplen;
}
@@ -1611,7 +1611,7 @@ reply_nxdomain(struct sreply *sreply)
/* 2 compress the label if possible */
- if ((tmplen = compress_label(reply, outlen, labellen)) > 0) {
+ if ((tmplen = compress_label((u_char*)reply, outlen, labellen)) > 0) {
outlen = tmplen;
}
@@ -1896,7 +1896,7 @@ reply_noerror(struct sreply *sreply)
outlen = i;
/* compress the label if possible */
- if ((tmplen = compress_label(reply, outlen, labellen)) > 0) {
+ if ((tmplen = compress_label((u_char*)reply, outlen, labellen)) > 0) {
outlen = tmplen;
}
@@ -1919,7 +1919,7 @@ reply_noerror(struct sreply *sreply)
/* 2 compress the label if possible */
- if ((tmplen = compress_label(reply, outlen, labellen)) > 0) {
+ if ((tmplen = compress_label((u_char*)reply, outlen, labellen)) > 0) {
outlen = tmplen;
}
repomaster@centroid.eu