From 37c72b0e3fa24064b9725d708d1a80df138c8317 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 10 Oct 2022 15:20:15 +0000 Subject: Gate rrd == qrd relevant test behind S6DNS_O_STRICT Signed-off-by: Laurent Bercot --- src/libs6dns/s6dns_engine.c | 3 +-- 1 file changed, 1 insertion(+), 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 ; } -- cgit v1.2.3