Commit Diff
Diff:
df69c8444df99c894380229a7ee0c618dbf97ebb
36e05d781f4e1270dc592295c9dc81468488b230
Commit:
36e05d781f4e1270dc592295c9dc81468488b230
Tree:
1cf9e94fd1db1d300f4501e29bfc0336eaa6539c
Author:
pjp <pjp@delphinusdns.org>
Committer:
pjp <pjp@delphinusdns.org>
Date:
Sat Aug 8 05:51:48 2020 UTC
Message:
remove unused variables (partially deadening them) found with GCC 8.3 on OpenBSD, now compiles cleanly
blob - fe7e8046960fccca23785a0d72dae8c3e239827c
blob + 08b53e1dd62c1eacf976f08bdfe17bd9afff4222
--- additional.c
+++ additional.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: additional.c,v 1.38 2020/07/13 22:02:26 pjp Exp $
+ * $Id: additional.c,v 1.39 2020/08/08 05:51:48 pjp Exp $
*/
#include <sys/types.h>
@@ -807,7 +807,7 @@ additional_nsec(char *name, int namelen, int inttype,
struct answer *answer;
struct rrset *rrset = NULL;
struct rr *rrp = NULL;
- int tmplen, rroffset;
+ int tmplen;
int retcount;
time_t now;
@@ -820,7 +820,6 @@ additional_nsec(char *name, int namelen, int inttype,
if (rrp == NULL)
goto out;
- rroffset = offset;
/* check if we go over our return length */
if ((offset + namelen) > replylen)
@@ -898,7 +897,7 @@ additional_nsec3(char *name, int namelen, int inttype,
struct rrset *rrset;
struct rr *rrp;
- int tmplen, rroffset;
+ int tmplen;
u_int8_t *somelen;
int retcount;
time_t now;
@@ -912,7 +911,6 @@ additional_nsec3(char *name, int namelen, int inttype,
if (rrp == NULL)
goto out;
- rroffset = offset;
/* check if we go over our return length */
if ((offset + namelen) > replylen)
blob - 9a3e4a702e3e39cc0913630887c4a3895bccf27d
blob + 4b7bd93ad40c62c3e64172071d1ee8dcab67c976
--- axfr.c
+++ axfr.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: axfr.c,v 1.46 2020/07/08 12:29:02 pjp Exp $
+ * $Id: axfr.c,v 1.47 2020/08/08 05:51:48 pjp Exp $
*/
#include <sys/types.h>
@@ -850,7 +850,6 @@ axfr_connection(int so, char *address, int is_ipv6, dd
int outlen;
int rrcount;
int envelopcount;
- int rs;
int tsigkeylen;
struct node *n, *nx;
@@ -1067,7 +1066,6 @@ axfr_connection(int so, char *address, int is_ipv6, dd
envelopcount = 1;
RB_FOREACH_SAFE(n, domaintree, &db->head, nx) {
- rs = n->datalen;
if ((rbt = calloc(1, sizeof(struct rbtree))) == NULL) {
dolog(LOG_INFO, "calloc: %s\n", strerror(errno));
goto drop;
@@ -1280,7 +1278,6 @@ build_header(ddDB *db, char *reply, char *buf, struct
int
build_soa(ddDB *db, char *reply, int offset, struct rbtree *rbt, struct question *q)
{
- char *p;
char *label;
char *plabel;
@@ -1317,7 +1314,9 @@ build_soa(ddDB *db, char *reply, int offset, struct rb
offset += 12; /* up to rdata length */
+#if 0
p = (char *)&answer->rdata;
+#endif
label = ((struct soa *)rrp->rdata)->nsserver;
@@ -1601,8 +1600,8 @@ notifypacket(int so, void *vnotnp, void *vmd, int pack
struct notifyentry *notnp = (struct notifyentry *)vnotnp;
struct mzone *mz = (struct mzone *)notnp->mzone;
struct mzone_dest *md = (struct mzone_dest *)vmd;
- struct sockaddr_in bsin, *sin;
- struct sockaddr_in6 bsin6, *sin6;
+ struct sockaddr_in bsin;
+ struct sockaddr_in6 bsin6;
struct sockaddr_storage savesin, newsin;
char packet[512];
char *questionname;
@@ -1699,7 +1698,6 @@ notifypacket(int so, void *vnotnp, void *vmd, int pack
struct sockaddr_in *tmpsin = (struct sockaddr_in *)&md->notifydest;
slen = sizeof(struct sockaddr_in);
- sin = (struct sockaddr_in *)&md->notifydest;
memset(&bsin, 0, sizeof(bsin));
bsin.sin_family = AF_INET;
bsin.sin_port = htons(md->port);
@@ -1710,7 +1708,6 @@ notifypacket(int so, void *vnotnp, void *vmd, int pack
struct sockaddr_in6 *tmpsin = (struct sockaddr_in6 *)&md->notifydest;
slen = sizeof(struct sockaddr_in6);
- sin6 = (struct sockaddr_in6 *)&md->notifydest;
memset(&bsin6, 0, sizeof(bsin6));
bsin6.sin6_family = AF_INET6;
bsin6.sin6_port = htons(md->port);
blob - 49ebee9b51ed5b7dd2737b4848d53caf75efde9a
blob + aeb1a9a696f4c7f4aa637a8210d57f57fdf4d10a
--- cache.c
+++ cache.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: cache.c,v 1.12 2020/08/03 08:54:07 pjp Exp $
+ * $Id: cache.c,v 1.13 2020/08/08 05:51:48 pjp Exp $
*/
#include <sys/types.h>
@@ -634,7 +634,6 @@ cache_nsec3param(struct scache *scache)
int
cache_txt(struct scache *scache)
{
- u_int8_t len;
int i;
uint16_t rdlen = scache->rdlen;
u_char *p = scache->payload;
@@ -644,7 +643,6 @@ cache_txt(struct scache *scache)
return -1;
BOUNDS_CHECK(scache->payload, q, scache->rdlen, scache->end);
- len = rdlen;
for (i = 0; i < rdlen; i++) {
if (i % 256 == 0)
@@ -815,8 +813,6 @@ cache_srv(struct scache *scache)
int
cache_naptr(struct scache *scache)
{
- u_int16_t tmp16;
- struct naptr n;
char *save;;
u_char *p = scache->payload;
u_char *q = p;
@@ -828,12 +824,16 @@ cache_naptr(struct scache *scache)
/* we won't cache naptr either for now */
return -1;
BOUNDS_CHECK((q + 2), scache->payload, scache->rdlen, scache->end);
+#if 0
tmp16 = unpack16(q);
n.order = ntohs(tmp16);
+#endif
q += 2;
BOUNDS_CHECK((q + 2), scache->payload, scache->rdlen, scache->end);
+#if 0
tmp16 = unpack16(q);
n.preference = ntohs(tmp16);
+#endif
q += 2;
blob - 4fb1473a149d44b6498ed7f813c1abe26f8c4646
blob + cff3b339e5bd532e0cdcfc79fcd31101e748d754
--- delphinusdnsd.c
+++ delphinusdnsd.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: delphinusdnsd.c,v 1.137 2020/07/28 06:49:24 pjp Exp $
+ * $Id: delphinusdnsd.c,v 1.138 2020/08/08 05:51:48 pjp Exp $
*/
@@ -1515,7 +1515,6 @@ mainloop(struct cfg *cfg, struct imsgbuf *ibuf)
int sel, oldsel;
int len, slen = 0;
- int is_ipv6;
int i, nomore = 0;
int istcp = 1;
int maxso;
@@ -1693,7 +1692,6 @@ mainloop(struct cfg *cfg, struct imsgbuf *ibuf)
#endif
for (;;) {
- is_ipv6 = 0;
maxso = 0;
FD_ZERO(&rset);
@@ -1810,7 +1808,6 @@ axfrentry:
}
if (from->sa_family == AF_INET6) {
- is_ipv6 = 1;
fromlen = sizeof(struct sockaddr_in6);
sin6 = (struct sockaddr_in6 *)from;
@@ -1834,7 +1831,6 @@ axfrentry:
}
} else if (from->sa_family == AF_INET) {
- is_ipv6 = 0;
fromlen = sizeof(struct sockaddr_in);
sin = (struct sockaddr_in *)from;
@@ -2636,7 +2632,6 @@ tcploop(struct cfg *cfg, struct imsgbuf *ibuf, struct
fd_set rset;
int sel;
int len, slen = 0;
- int is_ipv6;
int i;
int istcp = 1;
int maxso;
@@ -2764,7 +2759,6 @@ tcploop(struct cfg *cfg, struct imsgbuf *ibuf, struct
}
for (;;) {
- is_ipv6 = 0;
maxso = 0;
FD_ZERO(&rset);
@@ -2819,7 +2813,6 @@ tcploop(struct cfg *cfg, struct imsgbuf *ibuf, struct
}
if (from->sa_family == AF_INET6) {
- is_ipv6 = 1;
fromlen = sizeof(struct sockaddr_in6);
sin6 = (struct sockaddr_in6 *)from;
@@ -2836,7 +2829,6 @@ tcploop(struct cfg *cfg, struct imsgbuf *ibuf, struct
require_tsig = find_tsig((struct sockaddr_storage *)sin6, AF_INET6);
}
} else if (from->sa_family == AF_INET) {
- is_ipv6 = 0;
fromlen = sizeof(struct sockaddr_in);
sin = (struct sockaddr_in *)from;
@@ -3572,7 +3564,6 @@ parseloop(struct cfg *cfg, struct imsgbuf *ibuf)
char *packet;
fd_set rset;
int sel;
- int require_tsig = 0;
int fd = mybuf->fd;
ssize_t n, datalen;
@@ -3618,7 +3609,6 @@ parseloop(struct cfg *cfg, struct imsgbuf *ibuf)
}
datalen = imsg.hdr.len - IMSG_HEADER_SIZE;
- require_tsig = 0;
memset(&pq, 0, sizeof(struct parsequestion));
@@ -3932,14 +3922,12 @@ determine_glue(ddDB *db)
{
struct rbtree *rbt, *rbt0;
struct rrset *rrset;
- int rs;
struct node *n, *nx;
int len;
int have_soa = 0, have_ns = 0;
char *p;
RB_FOREACH_SAFE(n, domaintree, &db->head, nx) {
- rs = n->datalen;
rbt = (struct rbtree *)n->data;
rrset = find_rr(rbt, DNS_TYPE_SOA);
@@ -3960,7 +3948,6 @@ determine_glue(ddDB *db)
/* mark SOA's */
RB_FOREACH_SAFE(n, domaintree, &db->head, nx) {
- rs = n->datalen;
rbt = (struct rbtree *)n->data;
rrset = find_rr(rbt, DNS_TYPE_SOA);
@@ -3973,7 +3960,6 @@ determine_glue(ddDB *db)
/* mark glue */
RB_FOREACH_SAFE(n, domaintree, &db->head, nx) {
- rs = n->datalen;
rbt = (struct rbtree *)n->data;
if (rbt->flags & RBT_APEX) {
@@ -3989,7 +3975,6 @@ determine_glue(ddDB *db)
}
RB_FOREACH_SAFE(n, domaintree, &db->head, nx) {
- rs = n->datalen;
rbt = (struct rbtree *)n->data;
@@ -4040,7 +4025,7 @@ determine_glue(ddDB *db)
void
setup_cortex(struct imsgbuf *ibuf)
{
- int sel, max = 0;
+ int max = 0;
int datalen, nomore = 0;
ssize_t n;
@@ -4109,7 +4094,7 @@ setup_cortex(struct imsgbuf *ibuf)
FD_SET(neup->ibuf.fd, &rset);
}
- sel = select(max + 1, &rset, NULL, NULL, NULL);
+ select(max + 1, &rset, NULL, NULL, NULL);
SLIST_FOREACH(neup, &neuronhead, entries) {
if (FD_ISSET(neup->ibuf.fd, &rset)) {
blob - 3601fedd150f76aeedf1c0e60e1145d18f25dcd1
blob + 6f7ed18f15bc57b2ddc653234e4a5b35c4b62e82
--- forward.c
+++ forward.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: forward.c,v 1.40 2020/07/30 05:14:29 pjp Exp $
+ * $Id: forward.c,v 1.41 2020/08/08 05:51:48 pjp Exp $
*/
#include <sys/types.h>
@@ -1200,7 +1200,6 @@ returnit(ddDB *db, struct cfg *cfg, struct forwardqueu
static char *buf = NULL;
char *p;
- int so;
int i; /* = v/r */
int sel, rc;
int len = 0;
@@ -1223,7 +1222,6 @@ returnit(ddDB *db, struct cfg *cfg, struct forwardqueu
len = 2;
} else {
p = buf;
- so = -1;
}
if (rlen <= sizeof(struct dns_header)) {
@@ -1528,7 +1526,6 @@ check_tsig(char *buf, int len, char *mac)
char expand[DNS_MAXNAME + 1];
u_int rollback, i, j;
u_int16_t type, rdlen;
- u_int32_t ttl;
u_int64_t timefudge;
int elen = 0;
int additional;
@@ -1640,8 +1637,10 @@ check_tsig(char *buf, int len, char *mac)
break;
}
+#if 0
/* RFC 3225 */
ttl = ntohl(opt->ttl);
+#endif
i += 11 + ntohs(opt->rdlen);
if (i > len) {
blob - 6cba8d410a54316610424dc5e0f25a7692ab456e
blob + 83a795fd60f944a2cfaa2a8394f8c13329b5d64f
--- parse.y
+++ parse.y
@@ -21,7 +21,7 @@
*/
/*
- * $Id: parse.y,v 1.112 2020/07/27 05:11:19 pjp Exp $
+ * $Id: parse.y,v 1.113 2020/08/08 05:51:48 pjp Exp $
*/
%{
@@ -699,10 +699,6 @@ rzonestatement:
rz->active = 1;
rz->masterport = $2 & 0xffff;
-#ifdef __OpenBSD__
- if (debug)
- printf("at rzone %x, set masterport to %d\n", (unsigned int)rz, rz->masterport);
-#endif
}
|
MASTER ipcidr SEMICOLON CRLF
@@ -742,11 +738,6 @@ rzonestatement:
inet_pton(AF_INET, rz->master, &sin->sin_addr.s_addr);
}
-#ifdef __OpenBSD__
- if (debug)
- printf("at rzone %x, added master server at %s\n", (unsigned int)rz,
- p);
-#endif
free($2);
}
@@ -776,23 +767,11 @@ rzonestatement:
perror("dns_label");
return -1;
}
-#ifdef __OpenBSD__
- if (debug)
- printf("at rzone %x, added zonename of %s\n", (unsigned int)rz, p);
-#endif
} else if (strcmp($1, "filename") == 0) {
rz->filename = p;
-#ifdef __OpenBSD__
- if (debug)
- printf("at rzone %x, added filename of %s\n", (unsigned int)rz, p);
-#endif
} else if (strcmp($1, "tsigkey") == 0) {
rz->tsigkey = p;
-#ifdef __OpenBSD__
- if (debug)
- printf("at rzone %x, added tsigkey of %s\n", (unsigned int)rz, p);
-#endif
}
free($1);
@@ -2961,8 +2940,7 @@ fill_sshfp(ddDB *db, char *name, char *type, int myttl
struct rbtree *rbt;
int converted_namelen;
char *converted_name;
- int len, i;
- int ret;
+ int i;
for (i = 0; i < strlen(name); i++) {
name[i] = tolower((int)name[i]);
@@ -2983,10 +2961,10 @@ fill_sshfp(ddDB *db, char *name, char *type, int myttl
switch (fptype) {
case 1:
- len = sshfp->fplen = DNS_SSHFP_SIZE_SHA1;
+ sshfp->fplen = DNS_SSHFP_SIZE_SHA1;
break;
case 2:
- len = sshfp->fplen = DNS_SSHFP_SIZE_SHA256;
+ sshfp->fplen = DNS_SSHFP_SIZE_SHA256;
break;
default:
dolog(LOG_ERR, "sshfp: unknown fingerprint type!\n");
@@ -2994,7 +2972,7 @@ fill_sshfp(ddDB *db, char *name, char *type, int myttl
}
memset(sshfp->fingerprint, 0, sizeof(sshfp->fingerprint));
- ret = hex2bin(fingerprint, strlen(fingerprint), sshfp->fingerprint);
+ hex2bin(fingerprint, strlen(fingerprint), sshfp->fingerprint);
rbt = create_rr(db, converted_name, converted_namelen, DNS_TYPE_SSHFP, sshfp, myttl, 0);
@@ -3885,10 +3863,6 @@ add_rzone(void)
lrz->constraints.expire = 60;
SLIST_INSERT_HEAD(&rzones, lrz, rzone_entry);
-#ifdef __OpenBSD__
- if (debug)
- printf("added rzone at 0x%x\n", (unsigned int)lrz);
-#endif
return (lrz);
}
blob - 59bdab47fc6b29039d7e5d3aff543073a60f2f02
blob + e24983585873dca4d65c42823f661a03da379b7c
--- raxfr.c
+++ raxfr.c
@@ -26,7 +26,7 @@
*
*/
/*
- * $Id: raxfr.c,v 1.61 2020/07/28 05:17:05 pjp Exp $
+ * $Id: raxfr.c,v 1.62 2020/08/08 05:51:48 pjp Exp $
*/
#include <sys/types.h>
@@ -222,7 +222,7 @@ raxfr_peek(FILE *f, u_char *p, u_char *estart, u_char
char *humanname;
u_char expand[256];
u_char *q = p;
- u_int16_t rtype, rclass, rdtmp;
+ u_int16_t rtype, rdtmp;
u_int32_t rttl;
int elen = 0;
int max = sizeof(expand);
@@ -248,7 +248,9 @@ raxfr_peek(FILE *f, u_char *p, u_char *estart, u_char
if ((q + 2) > end)
return -1;
+#if 0
rclass = unpack16(q);
+#endif
q += 2;
if ((q + 4) > end)
@@ -875,7 +877,6 @@ raxfr_nsec3param(FILE *f, u_char *p, u_char *estart, u
{
struct nsec3param np;
u_int16_t iter;
- char *hex;
u_char *q = p;
BOUNDS_CHECK((p + 1), q, rdlen, end);
@@ -892,7 +893,7 @@ raxfr_nsec3param(FILE *f, u_char *p, u_char *estart, u
memcpy(&np.salt, p, np.saltlen);
p += np.saltlen;
- hex = bin2hex(np.salt, np.saltlen);
+ bin2hex(np.salt, np.saltlen);
if (f != NULL) {
fprintf(f, "%u,%u,%u,\"%s\"\n", np.algorithm, np.flags,
@@ -910,12 +911,10 @@ raxfr_nsec3param(FILE *f, u_char *p, u_char *estart, u
int
raxfr_txt(FILE *f, u_char *p, u_char *estart, u_char *end, struct soa *mysoa, u_int16_t rdlen, HMAC_CTX *ctx)
{
- u_int8_t len;
int i;
u_char *q = p;
BOUNDS_CHECK(p, q, rdlen, end);
- len = rdlen;
if (f != NULL)
fprintf(f, "\"");
@@ -1284,7 +1283,7 @@ raxfr_tsig(FILE *f, u_char *p, u_char *estart, u_char
char *otherdata;
u_char expand[256];
u_char *q = p;
- u_int16_t rtype, rclass, origid, tsigerror, otherlen;
+ u_int16_t rtype, rclass, tsigerror, otherlen;
u_int32_t rttl;
int rlen, rrlen = -1;
int elen = 0;
@@ -1381,7 +1380,9 @@ raxfr_tsig(FILE *f, u_char *p, u_char *estart, u_char
if ((q + 2) > end)
goto out;
+#if 0
origid = unpack16(q);
+#endif
q += 2;
if ((q + 2) > end)
blob - 58030fccb566edfd0891b98015f0a85d87fb92c8
blob + 73e3473f4080038057517b006d4f9f546782a7dd
--- reply.c
+++ reply.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: reply.c,v 1.111 2020/07/23 10:48:45 pjp Exp $
+ * $Id: reply.c,v 1.112 2020/08/08 05:51:48 pjp Exp $
*/
#include <sys/types.h>
@@ -2697,7 +2697,6 @@ reply_ns(struct sreply *sreply, int *sretlen, ddDB *db
int replysize = 512;
int retlen = -1;
u_int16_t rollback;
- int ns_type;
int delegation, addiscount;
int addcount = 0;
int retcount;
@@ -2780,7 +2779,9 @@ reply_ns(struct sreply *sreply, int *sretlen, ddDB *db
name = ((struct ns *)rrp->rdata)->nsserver;
namelen = ((struct ns *)rrp->rdata)->nslen;
+#if 0
ns_type = ((struct ns *)rrp->rdata)->ns_type;
+#endif
answer->rdlength = htons(namelen);
@@ -3085,7 +3086,6 @@ reply_cname(struct sreply *sreply, int *sretlen, ddDB
char *reply = sreply->replybuf;
struct dns_header *odh;
u_int16_t outlen;
- char *p;
int i, tmplen;
int labellen;
char *label, *plabel;
@@ -3172,7 +3172,9 @@ reply_cname(struct sreply *sreply, int *sretlen, ddDB
outlen += 12; /* up to rdata length */
+#if 0
p = (char *)&answer->rdata;
+#endif
label = (char *)&((struct cname *)rrp->rdata)->cname;
labellen = ((struct cname *)rrp->rdata)->cnamelen;
@@ -3429,7 +3431,6 @@ reply_ptr(struct sreply *sreply, int *sretlen, ddDB *d
char *reply = sreply->replybuf;
struct dns_header *odh;
u_int16_t outlen;
- char *p;
int i, tmplen;
int labellen;
char *label, *plabel;
@@ -3513,7 +3514,9 @@ reply_ptr(struct sreply *sreply, int *sretlen, ddDB *d
outlen += 12; /* up to rdata length */
+#if 0
p = (char *)&answer->rdata;
+#endif
label = ((struct ptr *)rrp->rdata)->ptr;
labellen = ((struct ptr *)rrp->rdata)->ptrlen;
@@ -3625,7 +3628,6 @@ reply_soa(struct sreply *sreply, int *sretlen, ddDB *d
char *reply = sreply->replybuf;
struct dns_header *odh;
u_int16_t outlen;
- char *p;
int i, tmplen;
int labellen;
char *label, *plabel;
@@ -3711,7 +3713,9 @@ reply_soa(struct sreply *sreply, int *sretlen, ddDB *d
outlen += 12; /* up to rdata length */
+#if 0
p = (char *)&answer->rdata;
+#endif
label = ((struct soa *)rrp->rdata)->nsserver;
@@ -4113,7 +4117,6 @@ reply_version(struct sreply *sreply, int *sretlen, ddD
int istcp = sreply->istcp;
int replysize = 512;
int retlen = -1;
- u_int16_t rollback;
if (istcp) {
replysize = 65535;
@@ -4135,7 +4138,6 @@ reply_version(struct sreply *sreply, int *sretlen, ddD
memcpy(reply, buf, sizeof(struct dns_header) + q->hdr->namelen + 4);
outlen += (q->hdr->namelen + 4);
- rollback = outlen;
/* blank query */
memset((char *)&odh->query, 0, sizeof(u_int16_t));
@@ -4604,9 +4606,7 @@ reply_naptr(struct sreply *sreply, int *sretlen, ddDB
char *reply = sreply->replybuf;
struct dns_header *odh;
int naptr_count;
- char *name;
u_int16_t outlen;
- u_int16_t namelen;
struct answer {
char name[2];
@@ -4633,6 +4633,7 @@ reply_naptr(struct sreply *sreply, int *sretlen, ddDB
int istcp = sreply->istcp;
int replysize = 512;
int tmplen, savelen;
+ int namelen;
char *p;
int retlen = -1;
u_int16_t rollback;
@@ -4715,7 +4716,9 @@ reply_naptr(struct sreply *sreply, int *sretlen, ddDB
memcpy((char *)p, (char *)((struct naptr *)rrp->rdata)->replacement, ((struct naptr *)rrp->rdata)->replacementlen);
+#if 0
name = ((struct naptr *)rrp->rdata)->replacement;
+#endif
namelen = ((struct naptr *)rrp->rdata)->replacementlen;
outlen += (12 + 4 + ((struct naptr *)rrp->rdata)->replacementlen);
@@ -4833,9 +4836,7 @@ reply_srv(struct sreply *sreply, int *sretlen, ddDB *d
char *reply = sreply->replybuf;
struct dns_header *odh;
int srv_count;
- char *name;
u_int16_t outlen;
- u_int16_t namelen;
struct answer {
char name[2];
@@ -4924,8 +4925,10 @@ reply_srv(struct sreply *sreply, int *sretlen, ddDB *d
memcpy((char *)&answer->target, (char *)((struct srv *)rrp->rdata)->target, ((struct srv *)rrp->rdata)->targetlen);
+#if 0
name = ((struct srv *)rrp->rdata)->target;
namelen = ((struct srv *)rrp->rdata)->targetlen;
+#endif
outlen += (12 + 6 + ((struct srv *)rrp->rdata)->targetlen);
@@ -5100,7 +5103,6 @@ reply_nxdomain(struct sreply *sreply, int *sretlen, dd
char *reply = sreply->replybuf;
struct dns_header *odh;
u_int16_t outlen;
- char *p;
int i, tmplen;
int labellen;
char *label, *plabel;
@@ -5234,7 +5236,6 @@ reply_nxdomain(struct sreply *sreply, int *sretlen, dd
outlen += 10; /* sizeof(struct answer) up to rdata length */
- p = (char *)&answer->rdata;
label = ((struct soa *)rrp->rdata)->nsserver;
labellen = ((struct soa *)rrp->rdata)->nsserver_len;
@@ -5831,7 +5832,6 @@ reply_noerror(struct sreply *sreply, int *sretlen, ddD
char *reply = sreply->replybuf;
struct dns_header *odh;
u_int16_t outlen;
- char *p;
int i, tmplen;
int labellen;
char *label, *plabel;
@@ -5953,7 +5953,6 @@ reply_noerror(struct sreply *sreply, int *sretlen, ddD
outlen += 10; /* up to rdata length */
- p = (char *)&answer->rdata;
label = ((struct soa *)rrp->rdata)->nsserver;
labellen = ((struct soa *)rrp->rdata)->nsserver_len;
blob - c65fe7ec5a476a814cfedf4679249c394725f18f
blob + 009b8849707226033d649d15547b5308631024af
--- sign.c
+++ sign.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: sign.c,v 1.10 2020/07/23 16:04:01 pjp Exp $
+ * $Id: sign.c,v 1.11 2020/08/08 05:51:48 pjp Exp $
*/
#include <sys/types.h>
@@ -1070,7 +1070,6 @@ create_key_ec(char *zonename, int ttl, int flags, int
char *p;
int binlen;
- int len;
mode_t savemask;
time_t now;
@@ -1170,7 +1169,7 @@ create_key_ec(char *zonename, int ttl, int flags, int
fprintf(f, "Algorithm: %d (%s)\n", algorithm, alg_to_name(algorithm));
/* PrivateKey */
binlen = BN_bn2bin(ecprivatekey, (char *)&bin);
- len = mybase64_encode(bin, binlen, b64, sizeof(b64));
+ mybase64_encode(bin, binlen, b64, sizeof(b64));
fprintf(f, "PrivateKey: %s\n", b64);
now = time(NULL);
@@ -1231,7 +1230,7 @@ create_key_ec(char *zonename, int ttl, int flags, int
p++;
binlen--;
- len = mybase64_encode(p, binlen, b64, sizeof(b64));
+ mybase64_encode(p, binlen, b64, sizeof(b64));
fprintf(f, "%s%s %d IN DNSKEY %d 3 %d %s\n", zonename, (zonename[strlen(zonename) - 1] == '.') ? "" : ".", ttl, flags, algorithm, b64);
fclose(f);
@@ -1307,7 +1306,7 @@ create_key_rsa(char *zonename, int ttl, int flags, int
char bin[4096];
char b64[4096];
char tmp[4096];
- int i, binlen, len;
+ int i, binlen;
char *retval;
char *p;
time_t now;
@@ -1461,39 +1460,39 @@ create_key_rsa(char *zonename, int ttl, int flags, int
fprintf(f, "Algorithm: %d (%s)\n", algorithm, alg_to_name(algorithm));
/* modulus */
binlen = BN_bn2bin(rsan, (char *)&bin);
- len = mybase64_encode(bin, binlen, b64, sizeof(b64));
+ mybase64_encode(bin, binlen, b64, sizeof(b64));
fprintf(f, "Modulus: %s\n", b64);
/* public exponent */
binlen = BN_bn2bin(rsae, (char *)&bin);
- len = mybase64_encode(bin, binlen, b64, sizeof(b64));
+ mybase64_encode(bin, binlen, b64, sizeof(b64));
fprintf(f, "PublicExponent: %s\n", b64);
/* private exponent */
binlen = BN_bn2bin(rsad, (char *)&bin);
- len = mybase64_encode(bin, binlen, b64, sizeof(b64));
+ mybase64_encode(bin, binlen, b64, sizeof(b64));
fprintf(f, "PrivateExponent: %s\n", b64);
/* get the RSA factors */
RSA_get0_factors(rsa, (const BIGNUM **)&rsap, (const BIGNUM **)&rsaq);
/* prime1 */
binlen = BN_bn2bin(rsap, (char *)&bin);
- len = mybase64_encode(bin, binlen, b64, sizeof(b64));
+ mybase64_encode(bin, binlen, b64, sizeof(b64));
fprintf(f, "Prime1: %s\n", b64);
/* prime2 */
binlen = BN_bn2bin(rsaq, (char *)&bin);
- len = mybase64_encode(bin, binlen, b64, sizeof(b64));
+ mybase64_encode(bin, binlen, b64, sizeof(b64));
fprintf(f, "Prime2: %s\n", b64);
/* get the RSA crt params */
RSA_get0_crt_params(rsa, (const BIGNUM **)&rsadmp1, (const BIGNUM **)&rsadmq1, (const BIGNUM **)&rsaiqmp);
/* exponent1 */
binlen = BN_bn2bin(rsadmp1, (char *)&bin);
- len = mybase64_encode(bin, binlen, b64, sizeof(b64));
+ mybase64_encode(bin, binlen, b64, sizeof(b64));
fprintf(f, "Exponent1: %s\n", b64);
/* exponent2 */
binlen = BN_bn2bin(rsadmq1, (char *)&bin);
- len = mybase64_encode(bin, binlen, b64, sizeof(b64));
+ mybase64_encode(bin, binlen, b64, sizeof(b64));
fprintf(f, "Exponent2: %s\n", b64);
/* coefficient */
binlen = BN_bn2bin(rsaiqmp, (char *)&bin);
- len = mybase64_encode(bin, binlen, b64, sizeof(b64));
+ mybase64_encode(bin, binlen, b64, sizeof(b64));
fprintf(f, "Coefficient: %s\n", b64);
now = time(NULL);
@@ -1560,7 +1559,7 @@ create_key_rsa(char *zonename, int ttl, int flags, int
pack(p, tmp, binlen);
p += binlen;
binlen = (p - &bin[0]);
- len = mybase64_encode(bin, binlen, b64, sizeof(b64));
+ mybase64_encode(bin, binlen, b64, sizeof(b64));
fprintf(f, "%s%s %d IN DNSKEY %d 3 %d %s\n", zonename, (zonename[strlen(zonename) - 1] == '.') ? "" : ".", ttl, flags, algorithm, b64);
fclose(f);
@@ -6684,7 +6683,7 @@ construct_nsec3(ddDB *db, char *zone, int iterations,
int labellen;
u_int32_t ttl = 0;
- int j, rs, len, rootlen;
+ int rs, len, rootlen;
TAILQ_HEAD(listhead, mynsec3) head;
@@ -6741,8 +6740,6 @@ construct_nsec3(ddDB *db, char *zone, int iterations,
n3p.saltlen = ((struct nsec3param *)rrp2->rdata)->saltlen;
memcpy((char *)&n3p.salt, ((struct nsec3param *)rrp2->rdata)->salt,
((struct nsec3param *)rrp2->rdata)->saltlen);
-
- j = 0;
RB_FOREACH_SAFE(n, domaintree, &db->head, nx) {
rs = n->datalen;
blob - 079ca7b0b7d61728076958f7e24074726a52e0ed
blob + d26b3c1e502b7bf85c0daf89bcc206091e787926
--- util.c
+++ util.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: util.c,v 1.81 2020/07/27 08:23:04 pjp Exp $
+ * $Id: util.c,v 1.82 2020/08/08 05:51:48 pjp Exp $
*/
#include <sys/types.h>
@@ -1087,7 +1087,6 @@ build_question(char *buf, int len, int additional, cha
/* in IXFR an additional SOA entry is tacked on, we want to skip this */
do {
u_int16_t val16;
- u_int32_t val32;
rollback = i;
@@ -1123,7 +1122,9 @@ build_question(char *buf, int len, int additional, cha
i += 2;
o += 2;
/* ttl */
+#if 0
val32 = unpack32(o);
+#endif
i += 4;
o += 4;
val16 = unpack16(o);
@@ -1843,7 +1844,6 @@ lookup_axfr(FILE *f, int so, char *zonename, struct so
u_char *end, *estart;
int len, totallen, zonelen, rrlen, rrtype;
int soacount = 0;
- int elen = 0;
int segmentcount = 0;
int count = 0;
u_int16_t rdlen, *plen;
@@ -2140,7 +2140,6 @@ lookup_axfr(FILE *f, int so, char *zonename, struct so
for (count = 0; count < segmentcount; count++) {
char mac[32];
- elen = 0;
if ((rrlen = raxfr_peek(f, p, estart, end, &rrtype, soacount, &rdlen, format, ctx, name, zonelen, 1)) < 0) {
fprintf(stderr, "not a SOA reply, or ERROR\n");
repomaster@centroid.eu