Commit Diff
Diff:
10b41d336bfe6b768fbb801f3cee8cc6c8025258
20069a501a305c796714d68db1be4765a6d17141
Commit:
20069a501a305c796714d68db1be4765a6d17141
Tree:
aa4513ccb3dec001f1df599ad458e385d93c1a64
Author:
pjp <pjp@delphinusdns.org>
Committer:
pjp <pjp@delphinusdns.org>
Date:
Thu Apr 25 05:54:09 2019 UTC
Message:
make linux compile again
blob - 6a7d47431d921c7fcf2a567efd6ff832323fa739
blob + 8270fabc33f39233185b1b184206d24c6086a5de
--- axfr.c
+++ axfr.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: axfr.c,v 1.25 2019/02/28 08:57:43 pjp Exp $
+ * $Id: axfr.c,v 1.26 2019/04/25 05:54:09 pjp Exp $
*/
#include "ddd-include.h"
@@ -971,7 +971,7 @@ axfr_connection(int so, char *address, int is_ipv6, dd
}
tsigctx = HMAC_CTX_new();
- if (HMAC_Init(tsigctx, (const void *)&tsigkey, tsigkeylen, EVP_sha256()) == 0) {
+ if (HMAC_Init_ex(tsigctx, (const void *)&tsigkey, tsigkeylen, EVP_sha256(), NULL) == 0) {
dolog(LOG_ERR, "AXFR tsig initialization error, drop\n");
goto drop;
}
@@ -1056,7 +1056,7 @@ axfr_connection(int so, char *address, int is_ipv6, dd
odh->additional = htons(1);
HMAC_CTX_reset(tsigctx);
- if (HMAC_Init(tsigctx, (const void *)&tsigkey, tsigkeylen, EVP_sha256()) == 0) {
+ if (HMAC_Init_ex(tsigctx, (const void *)&tsigkey, tsigkeylen, EVP_sha256(), NULL) == 0) {
dolog(LOG_ERR, "AXFR tsig initialization error, drop\n");
goto drop;
}
blob - 9ab2e1ee8d7ea43b2d62fcce8b5628be3167689c
blob + 244404fbdba1d4c2d8011a92c0de6aeb492a939c
--- db.c
+++ db.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: db.c,v 1.11 2019/04/07 15:18:27 pjp Exp $
+ * $Id: db.c,v 1.12 2019/04/25 05:54:09 pjp Exp $
*/
#include "ddd-include.h"
@@ -260,7 +260,11 @@ add_rr(struct rbtree *rbt, char *name, int len, u_int1
struct rrset *rp0, *rp;
struct rr *rt;
+#ifdef __linux__
+ TAILQ_FOREACH(rp, &rbt->rrset_head, entries) {
+#else
TAILQ_FOREACH_SAFE(rp, &rbt->rrset_head, entries, rp0) {
+#endif
if (rrtype == rp->rrtype)
break;
}
@@ -299,7 +303,11 @@ find_rr(struct rbtree *rbt, u_int16_t rrtype)
{
struct rrset *rp, *rp0;
+#ifdef __linux__
+ TAILQ_FOREACH(rp, &rbt->rrset_head, entries) {
+#else
TAILQ_FOREACH_SAFE(rp, &rbt->rrset_head, entries, rp0) {
+#endif
if (rrtype == rp->rrtype)
break;
}
@@ -318,7 +326,11 @@ display_rr(struct rrset *rrset)
{
struct rr *rrp, *rrp0;
+#ifdef __linux__
+ TAILQ_FOREACH(rrp, &rrset->rr_head, entries) {
+#else
TAILQ_FOREACH_SAFE(rrp, &rrset->rr_head, entries, rrp0) {
+#endif
printf("%lld:%u:%s\n", rrp->changed, rrp->ttl, (char *)rrp->rdata);
}
blob - 9ef35a25830e73835417a36436c7591fcb3224c6
blob + 49f76418d4e2b8352a3c1e6c9b6ecda22b5b2a7c
--- ddd-include.h
+++ ddd-include.h
@@ -27,7 +27,7 @@
*/
/*
- * $Id: ddd-include.h,v 1.9 2019/01/29 16:32:54 pjp Exp $
+ * $Id: ddd-include.h,v 1.10 2019/04/25 05:54:09 pjp Exp $
*/
#ifndef _INCLUDES_H
@@ -75,12 +75,15 @@
#ifdef __linux__
#include <grp.h>
+#define __USE_BSD 1
+#include <endian.h>
#include <bsd/stdlib.h>
#include <bsd/string.h>
#include <bsd/unistd.h>
#include <bsd/sys/queue.h>
#define __unused
#include <bsd/sys/tree.h>
+#include <bsd/sys/endian.h>
#include "imsg.h"
#else
#include <sys/queue.h>
blob - bfa0b8f85f3ff6e307edc3f270f347c91ee56e47
blob + 851bead2a8996915a653faea0b8cd7a1952d2cb9
--- dddctl.c
+++ dddctl.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: dddctl.c,v 1.57 2019/02/26 07:45:56 pjp Exp $
+ * $Id: dddctl.c,v 1.58 2019/04/25 05:54:09 pjp Exp $
*/
#include "ddd-include.h"
@@ -6924,10 +6924,12 @@ connect_server(char *nameserver, int port, u_int32_t f
return -1;
}
+#ifndef __linux__
/* biggen the window */
while (setsockopt(so, SOL_SOCKET, SO_RCVBUF, &window, sizeof(window)) != -1)
window <<= 1;
+#endif
memset(&sin, 0, sizeof(sin));
@@ -7503,7 +7505,9 @@ command_socket(char *sockpath)
close(so);
return -1;
}
+#ifndef __linux__
sun.sun_len = SUN_LEN(&sun);
+#endif
if (connect(so, (struct sockaddr *)&sun, sizeof(sun)) < 0) {
close(so);
blob - c22caf1bff775bc56dbed236951a9e579d7b4807
blob + 854e6492fef022ce2b2fcbce28535483d09c75b8
--- delphinusdnsd.c
+++ delphinusdnsd.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: delphinusdnsd.c,v 1.60 2019/02/26 08:15:33 pjp Exp $
+ * $Id: delphinusdnsd.c,v 1.61 2019/04/25 05:54:09 pjp Exp $
*/
#include "ddd-include.h"
@@ -3166,7 +3166,9 @@ setup_unixsocket(char *socketpath, struct imsgbuf *ibu
slave_shutdown();
exit(1);
}
+#ifndef __linux__
sun.sun_len = SUN_LEN(&sun);
+#endif
/* only root, 0100 == nonexecute */
if (umask(0177) < 0) {
blob - ebbd2422163bdc1a22b6e348d34d8689dfd3bfa6
blob + d49cbf56433eec507551769cfda81233fda3046d
--- parse.y
+++ parse.y
@@ -21,7 +21,7 @@
*/
/*
- * $Id: parse.y,v 1.65 2019/04/15 09:31:39 pjp Exp $
+ * $Id: parse.y,v 1.66 2019/04/25 05:54:09 pjp Exp $
*/
%{
@@ -433,8 +433,10 @@ rzonestatement:
rz->masterport = $2 & 0xffff;
+#ifndef __linux__
if (debug)
printf("at rzone %x, set masterport to %d\n", (unsigned int)rz, rz->masterport);
+#endif
}
|
MASTER ipcidr SEMICOLON CRLF
@@ -454,9 +456,11 @@ rzonestatement:
rz->master = p;
+#ifndef __linux__
if (debug)
printf("at rzone %x, added master server at %s\n", (unsigned int)rz,
p);
+#endif
free($2);
}
@@ -479,17 +483,23 @@ rzonestatement:
if (strcmp($1, "zonename") == 0) {
rz->zonename = p;
+#ifndef __linux__
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;
+#ifndef __linux__
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;
+#ifndef __linux__
if (debug)
printf("at rzone %x, added tsigkey of %s\n", (unsigned int)rz, p);
+#endif
}
free($1);
@@ -3434,8 +3444,10 @@ add_rzone(void)
lrz->filename = NULL;
SLIST_INSERT_HEAD(&rzones, lrz, rzone_entry);
+#ifndef __linux__
if (debug)
printf("added rzone at 0x%x\n", (unsigned int)lrz);
+#endif
return (lrz);
}
blob - 66111516bcc1b014c2a657438330a29b330d666f
blob + 89fe2b1aaf82a1f11ba7ed5ff23f717b1a222f41
--- util.c
+++ util.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: util.c,v 1.29 2019/03/01 09:01:06 pjp Exp $
+ * $Id: util.c,v 1.30 2019/04/25 05:54:09 pjp Exp $
*/
#include "ddd-include.h"
@@ -1045,7 +1045,11 @@ build_question(char *buf, int len, int additional, cha
tsigrr = (struct dns_tsigrr *)&buf[i];
/* XXX */
+#ifdef __linux__
+ timefudge = be64toh(tsigrr->timefudge);
+#else
timefudge = betoh64(tsigrr->timefudge);
+#endif
fudge = (u_int16_t)(timefudge & 0xffff);
tsigtime = (u_int64_t)(timefudge >> 16);
repomaster@centroid.eu