Commit Diff
Diff:
c836d9e9977cbc736f3a48a2fbd80dfa17dd8c4d
73e936f359a98770beaf0d275e0f4da618ca30a0
Commit:
73e936f359a98770beaf0d275e0f4da618ca30a0
Tree:
16c55fd8502cf5279ff7f6577adb172333436b2f
Author:
pjp <pjp@delphinusdns.org>
Committer:
pjp <pjp@delphinusdns.org>
Date:
Wed Dec 4 06:52:55 2019 UTC
Message:
more potential SIGBUS conditions on octeon, I'll just do preventative work here it works on octeon and amd64
blob - 6fc1e370fe5552cd562e2122c2d6efdc2e8f8f72
blob + b7f53cfb0c898c9f4fb924549a0224cb0efdfbcc
--- additional.c
+++ additional.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: additional.c,v 1.30 2019/12/03 18:21:40 pjp Exp $
+ * $Id: additional.c,v 1.31 2019/12/04 06:52:55 pjp Exp $
*/
#include <sys/types.h>
@@ -117,8 +117,9 @@ additional_a(char *name, int namelen, struct rbtree *r
struct answer *answer;
struct rrset *rrset = NULL;
struct rr *rrp = NULL;
+ int tmpcount = 0;
- *retcount = 0;
+ pack32((char *)retcount, 0);
if ((rrset = find_rr(rbt, DNS_TYPE_A)) == NULL)
return 0;
@@ -150,11 +151,12 @@ additional_a(char *name, int namelen, struct rbtree *r
memcpy((char *)&answer->rdata, (char *)&((struct a *)rrp->rdata)->a, sizeof(in_addr_t));
offset += sizeof(struct answer);
- (*retcount)++;
+ tmpcount++;
a_count++;
}
+ pack32((char *)retcount, tmpcount);
out:
return (offset);
@@ -183,8 +185,9 @@ additional_aaaa(char *name, int namelen, struct rbtree
struct answer *answer;
struct rrset *rrset = NULL;
struct rr *rrp = NULL;
+ int tmpcount = 0;
- *retcount = 0;
+ pack32((char *)retcount, 0);
if ((rrset = find_rr(rbt, DNS_TYPE_AAAA)) == NULL)
return 0;
@@ -217,11 +220,12 @@ additional_aaaa(char *name, int namelen, struct rbtree
memcpy((char *)&answer->rdata, (char *)&((struct aaaa *)rrp->rdata)->aaaa, sizeof(struct in6_addr));
offset += sizeof(struct answer);
- (*retcount)++;
+ tmpcount++;
aaaa_count++;
}
+ pack32((char *)retcount, tmpcount);
out:
return (offset);
@@ -250,8 +254,9 @@ additional_mx(char *name, int namelen, struct rbtree *
struct answer *answer;
struct rrset *rrset = NULL;
struct rr *rrp = NULL;
+ int tmpcount = 0;
- *retcount = 0;
+ pack32((char *)retcount, 0);
if ((rrset = find_rr(rbt, DNS_TYPE_MX)) == NULL)
return 0;
@@ -302,10 +307,12 @@ additional_mx(char *name, int namelen, struct rbtree *
answer->rdlength = htons(((struct smx *)rrp->rdata)->exchangelen + sizeof(u_int16_t));
- (*retcount)++;
+ tmpcount++;
mx_count++;
}
+
+ pack32((char *)retcount, tmpcount);
return (offset);
@@ -333,8 +340,9 @@ additional_ptr(char *name, int namelen, struct rbtree
struct answer *answer;
struct rrset *rrset = NULL;
struct rr *rrp = NULL;
+ int tmpcount = 0;
- *retcount = 0;
+ pack32((char *)retcount, 0);
if ((rrset = find_rr(rbt, DNS_TYPE_PTR)) == NULL)
return 0;
@@ -384,7 +392,8 @@ additional_ptr(char *name, int namelen, struct rbtree
answer->rdlength = htons(((struct ptr *)rrp->rdata)->ptrlen);
- (*retcount)++;
+ tmpcount++;
+ pack32((char *)retcount, tmpcount);
out:
return (offset);
@@ -954,8 +963,9 @@ additional_ds(char *name, int namelen, struct rbtree *
struct answer *answer;
struct rrset *rrset = NULL;
struct rr *rrp = NULL;
+ int tmpcount = 0;
- *retcount = 0;
+ pack32((char *)retcount, 0);
if ((rrset = find_rr(rbt, DNS_TYPE_DS)) == NULL)
return 0;
@@ -1004,10 +1014,12 @@ additional_ds(char *name, int namelen, struct rbtree *
answer->rdlength = htons(((struct ds *)rrp->rdata)->digestlen + sizeof(u_int16_t) + sizeof(u_int8_t) + sizeof(u_int8_t));
- (*retcount)++;
+ tmpcount++;
ds_count++;
}
+
+ pack32((char *)retcount, tmpcount);
return (offset);
}
blob - 82d58c65a31ba027b426b353e14593c8689d05d8
blob + 96b73c9844e14a8384637d67c57067f1be147467
--- dddctl.c
+++ dddctl.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: dddctl.c,v 1.91 2019/12/03 18:21:40 pjp Exp $
+ * $Id: dddctl.c,v 1.92 2019/12/04 06:52:55 pjp Exp $
*/
#include <sys/param.h>
@@ -1012,7 +1012,7 @@ parse_keyfile(int fd, uint32_t *ttl, uint16_t *flags,
if (q == NULL)
return NULL;
*q = '\0';
- *keyid = atoi(p);
+ pack32((char *)keyid, atoi(p));
}
continue;
@@ -6574,7 +6574,7 @@ connect_server(char *nameserver, int port, u_int32_t f
int
lookup_name(FILE *f, int so, char *zonename, u_int16_t myrrtype, struct soa *mysoa, u_int32_t format, char *nameserver, u_int16_t port, int *answers, int *additionalcount)
{
- int len, i;
+ int len, i, tmp32;
int numansw, numaddi, numauth;
int printansw = 1, printauth = 1, printaddi = 1;
int rrtype, soacount = 0;
@@ -6738,9 +6738,10 @@ lookup_name(FILE *f, int so, char *zonename, u_int16_t
numansw = ntohs(rwh->dh.answer);
numauth = ntohs(rwh->dh.nsrr);
numaddi = ntohs(rwh->dh.additional);
- *answers = numansw + numauth + numaddi;
+ tmp32 = (numansw + numauth + numaddi);
+ pack32((char *)answers, tmp32);
- if (*answers < 1) {
+ if (tmp32 < 1) {
fprintf(stderr, "NO ANSWER provided\n");
return -1;
}
@@ -7671,11 +7672,11 @@ bindfile(int argc, char *argv[])
char *
get_key(struct keysentry *kn, uint32_t *ttl, uint16_t *flags, uint8_t *protocol, uint8_t *algorithm, char *key, int keylen, int *keyid)
{
- *ttl = kn->ttl;
- *flags = kn->flags;
+ pack32((char *)ttl, kn->ttl);
+ pack16((char *)flags, kn->flags);
*protocol = kn->protocol;
*algorithm = kn->algorithm;
- *keyid = kn->keyid;
+ pack32((char *)keyid, kn->keyid);
strlcpy(key, kn->key, keylen);
blob - 24bb55fbd40b62b642c512dd82ded77fb95b7db4
blob + 7ed081206f4eff172e8042ef811a1c0a528c687f
--- raxfr.c
+++ raxfr.c
@@ -26,7 +26,7 @@
*
*/
/*
- * $Id: raxfr.c,v 1.42 2019/12/03 19:03:49 pjp Exp $
+ * $Id: raxfr.c,v 1.43 2019/12/04 06:52:55 pjp Exp $
*/
#include <sys/types.h>
@@ -232,10 +232,11 @@ raxfr_peek(FILE *f, u_char *p, u_char *estart, u_char
return -1;
rdtmp = unpack16(q);
- *rdlen = ntohs(rdtmp);
+ pack16((char *)rdlen, ntohs(rdtmp));
+
q += 2;
- *rrtype = ntohs(rtype);
+ pack32((char *)rrtype, ntohs(rtype));
if (ctx != NULL) {
if (*rrtype != DNS_TYPE_TSIG) {
@@ -1865,7 +1866,7 @@ get_remote_soa(struct rzone *rzone)
wh->dh.additional = htons(1);
}
- *tcpsize = htons(totallen - 2);
+ pack16((char *)tcpsize, htons(totallen - 2));
if (send(so, query, totallen, 0) < 0) {
close(so);
blob - 7be4e97ad859fd40f213c844612146f92bb230de
blob + 22bdebe413edc01c005b0d1e7ffea9a18a6157a6
--- util.c
+++ util.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: util.c,v 1.55 2019/12/03 18:21:40 pjp Exp $
+ * $Id: util.c,v 1.56 2019/12/04 06:52:55 pjp Exp $
*/
#include <sys/types.h>
@@ -290,7 +290,7 @@ dns_label(char *name, int *returnlen)
return NULL;
}
- *returnlen = newlen + 1;
+ pack32((char *)returnlen, (newlen + 1));
dnslabel[newlen] = '\0'; /* trailing NULL */
for (i = 0, p = dnslabel; i < lc; i++) {
@@ -526,9 +526,9 @@ get_ns(ddDB *db, struct rbtree *rbt, int *delegation)
int len;
if ((rrset = find_rr(rbt, DNS_TYPE_SOA)) == NULL) {
- *delegation = 1;
+ pack32((char *)delegation, 1);
} else {
- *delegation = 0;
+ pack32((char *)delegation, 0);
return (rbt);
}
@@ -547,7 +547,7 @@ get_ns(ddDB *db, struct rbtree *rbt, int *delegation)
}
if ((rrset = find_rr(rbt0, DNS_TYPE_SOA)) != NULL) {
- *delegation = 0;
+ pack32((char *)delegation, 0);
free(rbt0);
return (rbt);
}
repomaster@centroid.eu