From 7e434242bdaa3718c7146b31dcd81e24fe7dc3c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Thu, 18 Jun 2009 06:55:46 +0000 Subject: inet: do not filter responses in res_query MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes bug #5342 res_query was silently rejecting responses against T_ANY DNS questions. Remove the type-filtering from res_query altogether. __dns_lookup is supposed to return the proper stuff that you asked for (and only that). Signed-off-by: Timo Teräs Signed-off-by: Bernhard Reutner-Fischer --- libc/inet/resolv.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c index b557b097d..4777977fe 100644 --- a/libc/inet/resolv.c +++ b/libc/inet/resolv.c @@ -3732,11 +3732,10 @@ int res_query(const char *dname, int class, int type, free(a.dotted); - if (a.atype == type) { /* CNAME */ - if (i > anslen) - i = anslen; - memcpy(answer, packet, i); - } + if (i > anslen) + i = anslen; + memcpy(answer, packet, i); + free(packet); return i; } -- cgit v1.2.3