summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2022-10-10 15:20:15 +0000
committerLaurent Bercot <ska@appnovation.com>2022-10-10 15:20:15 +0000
commit37c72b0e3fa24064b9725d708d1a80df138c8317 (patch)
tree7548c60f2e85fe01bf3a033de5e8de4751a53007
parent709e6ba78eb0e69344649c918552f4b85349788e (diff)
downloads6-dns-37c72b0e3fa24064b9725d708d1a80df138c8317.tar.xz
Gate rrd == qrd relevant test behind S6DNS_O_STRICT
Signed-off-by: Laurent Bercot <ska@appnovation.com>
-rw-r--r--src/libs6dns/s6dns_engine.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libs6dns/s6dns_engine.c b/src/libs6dns/s6dns_engine.c
index 8c99194..4d61e78 100644
--- a/src/libs6dns/s6dns_engine.c
+++ b/src/libs6dns/s6dns_engine.c
@@ -36,8 +36,7 @@ static int relevant (char const *q, unsigned int qlen, char const *ans, unsigned
uint16_t id ;
s6dns_message_header_unpack(ans, &h) ;
if (!h.qr || h.opcode || h.z || (h.counts.qd != 1)) return 0 ;
- if (h.rd != (q[2] & 1)) return 0 ;
- if (strict && !h.aa && !(q[2] & 1)) return 0 ;
+ if (strict && ((!h.aa && !(q[2] & 1)) || h.rd != (q[2] & 1))) return 0 ;
uint16_unpack_big(q, &id) ;
if (id != h.id) return 0 ;
}