Commit Diff
Diff:
1ee083b73b9997fd55bfeb6fec58cc6bfa54eca8
6c56e645e3850530357a92aca2aca81ac637e453
Commit:
6c56e645e3850530357a92aca2aca81ac637e453
Tree:
55604d9a1b6888a11b70436fb8cd14f6fa8cc747
Author:
pjp <pjp@delphinusdns.org>
Committer:
pjp <pjp@delphinusdns.org>
Date:
Tue Nov 19 07:13:04 2019 UTC
Message:
this make Linux compile
blob - 3a555dfaf20efe7abb678b377a72d81df8c2a36b
blob + 3bc4eeaf08f1887a7bf5657676a2fe38a935bab7
--- Makefile.linux
+++ Makefile.linux
@@ -8,12 +8,15 @@ AR=ar
all: delphinusdnsd dddctl
-delphinusdnsd: imsg-buffer.o imsg.o additional.o parse.o delphinusdnsd.o reply.o region.o log.o axfr.o filter.o ratelimit.o whitelist.o base64.o dnssec.o util.o ent.o db.o tsig.o
- $(CC) $(CFLAGS) -o delphinusdnsd/delphinusdnsd additional.o imsg-buffer.o imsg.o delphinusdnsd.o parse.o reply.o region.o log.o axfr.o filter.o ratelimit.o whitelist.o base64.o dnssec.o util.o ent.o db.o tsig.o $(LDADD)
+delphinusdnsd: imsg-buffer.o imsg.o additional.o parse.o delphinusdnsd.o reply.o region.o log.o axfr.o filter.o ratelimit.o whitelist.o base64.o dnssec.o util.o ent.o db.o tsig.o raxfr.o
+ $(CC) $(CFLAGS) -o delphinusdnsd/delphinusdnsd additional.o imsg-buffer.o imsg.o delphinusdnsd.o parse.o reply.o region.o log.o axfr.o filter.o ratelimit.o whitelist.o base64.o dnssec.o util.o ent.o db.o tsig.o raxfr.o $(LDADD)
-dddctl: dddctl.o util.o dnssec.o parse.o base64.o ent.o raxfr.o tsig.o region.o
- $(CC) $(CFLAGS) -o dddctl/dddctl dddctl.o util.o dnssec.o base64.o parse.o ent.o db.o raxfr.o tsig.o region.o $(LDADD)
+dddctl: dddctl.o util.o dnssec.o parse.o base64.o ent.o raxfr.o tsig.o region.o imsg-buffer.o imsg.o
+ $(CC) $(CFLAGS) -o dddctl/dddctl dddctl.o util.o dnssec.o base64.o parse.o ent.o db.o raxfr.o tsig.o region.o imsg-buffer.o imsg.o $(LDADD)
+
+raxfr.o: raxfr.c
+ $(CC) $(CFLAGS) -c raxfr.c
imsg-buffer.o: imsg-buffer.c
$(CC) $(CFLAGS) -c imsg-buffer.c
blob - 9bb5d2601da5e9159cdd711639c9eaffe3ede0f6
blob + 17ce7c4082265a9dd01df3680aca0f4e78428ebf
--- axfr.c
+++ axfr.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: axfr.c,v 1.35 2019/11/05 17:07:20 pjp Exp $
+ * $Id: axfr.c,v 1.36 2019/11/19 07:13:04 pjp Exp $
*/
#include <sys/types.h>
@@ -358,7 +358,9 @@ axfrloop(int *afd, int sockcount, char **ident, ddDB *
sin6 = (struct sockaddr_in6 *)&from;
sin6->sin6_family = AF_INET6;
sin6->sin6_port = htons(0);
+#ifndef __linux__
sin6->sin6_len = sizeof(struct sockaddr_in6);
+#endif
if (bind(notifyfd[1], (struct sockaddr *)sin6, sizeof(*sin6)) < 0) {
dolog(LOG_INFO, "bind notify6: %s\n", strerror(errno));
@@ -1619,7 +1621,9 @@ notifypacket(int so, void *vnotnp, void *vmd, int pack
struct sockaddr_in6 *tmpsin = (struct sockaddr_in6 *)&newsin;
tmpsin->sin6_port = ((struct sockaddr_in6 *)&savesin)->sin6_port;
+#ifndef __linux__
tmpsin->sin6_len = sizeof(struct sockaddr_in6);
+#endif
if (bind(so, (struct sockaddr *)tmpsin, sizeof(struct sockaddr_in6)) < 0) {
dolog(LOG_INFO, "can't bind to v6 bind address found in mzone for zone \"%s\"", mz->humanname);
@@ -1697,7 +1701,9 @@ notifypacket(int so, void *vnotnp, void *vmd, int pack
memset(&bsin6, 0, sizeof(bsin6));
bsin6.sin6_family = AF_INET6;
bsin6.sin6_port = htons(md->port);
+#ifndef __linux__
bsin6.sin6_len = sizeof(struct sockaddr_in6);
+#endif
memcpy(&bsin6.sin6_addr, &tmpsin->sin6_addr, 16);
ret = sendto(so, packet, outlen, 0, (struct sockaddr *)&bsin6, slen);
blob - f5aeecfb0c92ba6883bb0fd3cca39c6e6895f700
blob + 42579a2b7b02d99fb9b553b57ac1760b8a911ae9
--- parse.y
+++ parse.y
@@ -21,7 +21,7 @@
*/
/*
- * $Id: parse.y,v 1.88 2019/11/18 18:46:01 pjp Exp $
+ * $Id: parse.y,v 1.89 2019/11/19 07:13:04 pjp Exp $
*/
%{
@@ -713,11 +713,15 @@ rzonestatement:
if (strchr(rz->master, ':')) {
rz->storage.ss_family = AF_INET6;
+#ifndef __linux__
rz->storage.ss_len = 16;
+#endif
inet_pton(AF_INET6, rz->master, &sin6->sin6_addr);
} else {
rz->storage.ss_family = AF_INET;
+#ifndef __linux__
rz->storage.ss_len = 4;
+#endif
inet_pton(AF_INET, rz->master, &sin->sin_addr.s_addr);
}
blob - ee876e20ac14ebda3f384884193145d41f00ee2b
blob + ec53ac5d9820c89999d61370ab947b03eee84f21
--- raxfr.c
+++ raxfr.c
@@ -26,7 +26,7 @@
*
*/
/*
- * $Id: raxfr.c,v 1.34 2019/11/18 18:46:01 pjp Exp $
+ * $Id: raxfr.c,v 1.35 2019/11/19 07:13:04 pjp Exp $
*/
#include <sys/types.h>
@@ -60,6 +60,7 @@
#include <bsd/sys/tree.h>
#include <bsd/sys/endian.h>
#include "imsg.h"
+#include "endian.h"
#else /* not linux */
#include <sys/queue.h>
#include <sys/tree.h>
@@ -1281,7 +1282,11 @@ replicantloop(ddDB *db, struct imsgbuf *ibuf, struct i
lastnow = time(NULL);
+#ifdef __linux__
+ SLIST_FOREACH(lrz, &rzones, rzone_entry) {
+#else
SLIST_FOREACH_SAFE(lrz, &rzones, rzone_entry, lrz0) {
+#endif
if (lrz->zonename == NULL)
continue;
@@ -1326,7 +1331,11 @@ replicantloop(ddDB *db, struct imsgbuf *ibuf, struct i
period = (tot_refresh / zonecount) / zonecount;
add_period = period;
+#ifdef __linux__
+ SLIST_FOREACH(lrz, &rzones, rzone_entry) {
+#else
SLIST_FOREACH_SAFE(lrz, &rzones, rzone_entry, lrz0) {
+#endif
if (lrz->zonename == NULL)
continue;
@@ -1457,7 +1466,11 @@ replicantloop(ddDB *db, struct imsgbuf *ibuf, struct i
}
}
+#ifdef __linux__
+ LIST_FOREACH(sp0, &myschedules, myschedule_entry) {
+#else
LIST_FOREACH_SAFE(sp0, &myschedules, myschedule_entry, sp1) {
+#endif
if (sp0->when <= now) {
/* we hit a timeout on refresh */
if (sp0->action == SCHEDULE_ACTION_REFRESH) {
@@ -1663,7 +1676,9 @@ get_remote_soa(struct rzone *rzone)
sin6.sin6_family = AF_INET6;
sin6.sin6_port = htons(rzone->masterport);
memcpy(&sin6.sin6_addr, (void *)&((struct sockaddr_in6 *)(&rzone->storage))->sin6_addr, sizeof(struct in6_addr));
+#ifndef __linux__
sin6.sin6_len = sizeof(struct sockaddr_in6);
+#endif
sa = (struct sockaddr *)&sin6;
slen = sizeof(struct sockaddr_in6);
} else {
@@ -2066,7 +2081,9 @@ do_raxfr(FILE *f, struct rzone *rzone)
sin6.sin6_family = AF_INET6;
sin6.sin6_port = htons(rzone->masterport);
memcpy(&sin6.sin6_addr, (void *)&((struct sockaddr_in6 *)(&rzone->storage))->sin6_addr, sizeof(struct in6_addr));
+#ifndef __linux__
sin6.sin6_len = sizeof(struct sockaddr_in6);
+#endif
sa = (struct sockaddr *)&sin6;
slen = sizeof(struct sockaddr_in6);
} else {
repomaster@centroid.eu