Commit Diff
Diff:
45f2bf58ec20f531e9fe8890bb545218a47569dd
dc12159628e906d4655c53c2e528541ed631976e
Commit:
dc12159628e906d4655c53c2e528541ed631976e
Tree:
26e2414d11790d148b15b7b39d03dcfc0948912c
Author:
pjp <pjp@delphinusdns.org>
Committer:
pjp <pjp@delphinusdns.org>
Date:
Fri Jul 17 05:40:18 2020 UTC
Message:
not all nameservers that delphinusdnsd forwards to may be strictly compatible with this draft: https://tools.ietf.org/html/draft-vixie-dnsext-dns0x20-00 So make it a configurable switch wether we would memcmp or memcasecmp around answers. The switch goes into the forward "" {} and is called strictx20. It defaults to on.
blob - cee4a72e2f34ff02973ea129d66e321dc61cf075
blob + 584d16560c0e989195e86677bcd967dcf3831862
--- dddctl.c
+++ dddctl.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: dddctl.c,v 1.112 2020/07/16 17:54:03 pjp Exp $
+ * $Id: dddctl.c,v 1.113 2020/07/17 05:40:18 pjp Exp $
*/
#include <sys/types.h>
@@ -83,6 +83,7 @@ int debug = 0;
int verbose = 0;
int forward = 0;
int forwardtsig = 0;
+int strictx20i = 1;
int zonecount = 0;
int cache = 0;
extern int dnssec;
blob - bd699e65f3e831971c640b00b71cde98dbb7ebc4
blob + ab8ecc0b7ce0ee24d01a3a1d57d415cf44885d12
--- delphinusdnsd.c
+++ delphinusdnsd.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: delphinusdnsd.c,v 1.131 2020/07/16 17:54:03 pjp Exp $
+ * $Id: delphinusdnsd.c,v 1.132 2020/07/17 05:40:19 pjp Exp $
*/
@@ -278,6 +278,7 @@ int bcount = 0;
int icount = 0;
int forward = 0;
int forwardtsig = 0;
+int strictx20i = 1;
int zonecount = 0;
int cache = 0;
u_int16_t port = 53;
blob - 7e327e60efb90b974ca3c965205d2a2d2a69bb09
blob + 03d32ae6dc19b2a26bec3d7d7309bd835e78aa6d
--- forward.c
+++ forward.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: forward.c,v 1.33 2020/07/16 12:02:38 pjp Exp $
+ * $Id: forward.c,v 1.34 2020/07/17 05:40:19 pjp Exp $
*/
#include <sys/types.h>
@@ -234,6 +234,7 @@ extern int tsig;
extern int dnssec;
extern int cache;
extern int forward;
+extern int strictx20i;
/*
@@ -1219,9 +1220,17 @@ returnit(ddDB *db, struct cfg *cfg, struct forwardqueu
dolog(LOG_INFO, "FORWARD returnit, question name can't fit in packet thus it gets dropped\n");
return;
} else {
- if (memcmp((char *)&dh[1], fwq->dnsname, fwq->dnsnamelen) != 0) {
- dolog(LOG_INFO, "reply for a question we didn't send, drop\n");
- return;
+ if (strictx20i) {
+ if (memcmp((char *)&dh[1], fwq->dnsname, fwq->dnsnamelen) != 0) {
+ dolog(LOG_INFO, "reply for a question we didn't send, drop\n");
+ return;
+ }
+ } else {
+ if (memcasecmp((char *)&dh[1], fwq->dnsname, fwq->dnsnamelen) != 0) {
+ dolog(LOG_INFO, "reply for a question we didn't send, drop\n");
+ return;
+ }
+
}
}
blob - 06a91472c79f1e02bce7307d0f068ade91efd219
blob + dee407632cac56d338a2ce350ac7e6077ebfbf3b
--- parse.y
+++ parse.y
@@ -21,7 +21,7 @@
*/
/*
- * $Id: parse.y,v 1.107 2020/07/16 17:54:03 pjp Exp $
+ * $Id: parse.y,v 1.108 2020/07/17 05:40:19 pjp Exp $
*/
%{
@@ -113,6 +113,7 @@ extern int errno;
extern int debug;
extern int forward;
extern int forwardtsig;
+extern int strictx20i;
extern int cache;
extern int zonecount;
extern int verbose;
@@ -253,7 +254,7 @@ int drop_privs(char *, struct passwd *);
%token ERROR AXFRPORT OPTIONS FILTER MZONE
%token PASSLIST ZINCLUDE MASTER MASTERPORT TSIGAUTH
%token TSIG NOTIFYDEST NOTIFYBIND PORT FORWARD
-%token INCOMINGTSIG DESTINATION CACHE
+%token INCOMINGTSIG DESTINATION CACHE STRICTX20
%token <v.string> POUND
%token <v.string> SEMICOLON
@@ -1476,6 +1477,15 @@ forwardstatement : INCOMINGTSIG STRING SEMICOLON CRLF
free ($2);
}
+ | STRICTX20 STRING SEMICOLON CRLF
+ {
+ if (strcmp($2, "no") == 0 ||
+ strcmp($2, "off") == 0)
+
+ strictx20i = 0;
+
+ free ($2);
+ }
| comment CRLF
;
@@ -1675,6 +1685,7 @@ struct tab cmdtab[] = {
{ "port", PORT, 0},
{ "region", REGION, STATE_IP },
{ "rzone", RZONE, 0 },
+ { "strictx20", STRICTX20, 0},
{ "tsig", TSIG, 0 },
{ "tsig-auth", TSIGAUTH, 0 },
{ "wildcard-only-for", WOF, STATE_IP },
repomaster@centroid.eu