Commit Diff
Diff:
ed64ab3f62660a896fb10f844dd087916cafd346
775f7fca031d66aafafc9f7ea85048e1de945bbe
Commit:
775f7fca031d66aafafc9f7ea85048e1de945bbe
Tree:
08b11d3b8eb9d98ca6e6760174de0deb727913db
Author:
pjp <pjp@delphinusdns.org>
Committer:
pjp <pjp@delphinusdns.org>
Date:
Sat Jul 11 06:18:36 2020 UTC
Message:
don't try to readjust rlen with tsigoffset when there is no tsigcheck, this fixes my non-tsig, non-cached forwarders
blob - 52798aaecbdc764e10deb8010d093cde9ea3e441
blob + f4b026f9626c9d10dee785c7a2f18a524b4bf317
--- forward.c
+++ forward.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: forward.c,v 1.17 2020/07/10 10:42:27 pjp Exp $
+ * $Id: forward.c,v 1.18 2020/07/11 06:18:36 pjp Exp $
*/
#include <sys/types.h>
@@ -1217,6 +1217,8 @@ returnit(ddDB *db, struct cfg *cfg, struct forwardqueu
if (fwq->tsigkey)
fwdpq->tsigcheck = 1;
+ else
+ fwdpq->tsigcheck = 0;
if (cache)
fwdpq->cache = 1;
@@ -1314,7 +1316,7 @@ returnit(ddDB *db, struct cfg *cfg, struct forwardqueu
switch (imsg.hdr.type) {
case IMSG_PARSEERROR_MESSAGE:
if (datalen != sizeof(int)) {
- dolog(LOG_ERR, "bad parserepy message, drop\n", fwdpq->rc);
+ dolog(LOG_ERR, "bad parserepy message, drop\n");
imsg_free(&imsg);
free(fwdpq);
return;
@@ -1385,7 +1387,8 @@ endimsg:
dh->additional--;
HTONS(dh->additional);
- rlen = fwdpq->tsig.tsigoffset;
+ if (fwdpq->tsigcheck)
+ rlen = fwdpq->tsig.tsigoffset;
free(fwdpq);
@@ -2004,7 +2007,6 @@ fwdparseloop(struct imsgbuf *ibuf, struct imsgbuf *bib
free(packet);
break;
}
- /* pjp */
dh = (struct dns_header *)packet;
if (! (ntohs(dh->query) & DNS_REPLY)) {
repomaster@centroid.eu