dnspr: a name server's answer with no records relayed as it is (#1292)
C/C++ CI Linux / ubuntu-24.04-arm (push) Waiting to run
C/C++ CI Linux / ubuntu-latest (push) Waiting to run
C/C++ CI MacOS / macos-15 (push) Waiting to run
C/C++ CI Windows / windows-2022 (push) Waiting to run
C/C++ CI cmake / macos-15 (push) Waiting to run
C/C++ CI cmake / ubuntu-24.04-arm (push) Waiting to run
C/C++ CI cmake / ubuntu-latest (push) Waiting to run
C/C++ CI cmake / windows-2022 (push) Waiting to run
C/C++ CI cmake / ubuntu-latest (wolfSSL) (push) Waiting to run

This commit is contained in:
Vladimir Dubrovin committed 2026-11-26 15:45:43 +03:00
1 parent 142f89cb4d
commit 1461dbaff0
1 file changed
+6 -9
+6 -9
View File
@@ -117,8 +117,8 @@ static void dnscache(struct clientparam *param, struct dnsquery *q, unsigned cha
} }
} }
/* An answer from a name server: to the client as it is if it has answers, /* An answer from a name server: to the client as it is, whatever it
else as the name not found. 1: the query is done. */ says. 1: the query is done. */
static int dnsreply(struct udploop *u, struct udpsession *ss, unsigned char *buf, int len){ static int dnsreply(struct udploop *u, struct udpsession *ss, unsigned char *buf, int len){
struct clientparam *param = ss->param; struct clientparam *param = ss->param;
struct dnsquery *q = ss->data; struct dnsquery *q = ss->data;
@@ -131,13 +131,10 @@ static int dnsreply(struct udploop *u, struct udpsession *ss, unsigned char *buf
buf[1] = q->cid[1]; buf[1] = q->cid[1];
param->statssrv64 += len; param->statssrv64 += len;
param->nreads++; param->nreads++;
if(buf[6] || buf[7]){ /* the answer goes to the client as it is, its code with no records
dnscache(param, q, buf, len); among them: the name not found is the server's word, not ours */
param->res = (udpanswer(u, param, buf, len) == len)? 0 : 822; if(buf[6] || buf[7]) dnscache(param, q, buf, len);
return 1; param->res = (udpanswer(u, param, buf, len) == len)? 0 : 822;
}
q->ip = 0;
param->res = dnsanswer(u, param, q, buf, len);
return 1; return 1;
} }