OSDN Git Service

inet: do not filter responses in res_query
authorTimo Teräs <timo.teras@iki.fi>
Thu, 18 Jun 2009 06:55:46 +0000 (06:55 +0000)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Wed, 20 Mar 2013 10:51:08 +0000 (11:51 +0100)
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 <timo.teras@iki.fi>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
libc/inet/resolv.c

index b557b09..4777977 100644 (file)
@@ -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;
 }