]> jfr.im git - irc/atheme/libmowgli-2.git/commitdiff
Fix IPv6 reverse DNS lookups (address to name conversion)
authorAaron Jones <redacted>
Thu, 15 Jan 2015 07:05:25 +0000 (07:05 +0000)
committerAlex Iadicicco <redacted>
Thu, 15 Jan 2015 07:58:58 +0000 (00:58 -0700)
The bug here is that it reverses the octets and appends a period
after each nibble, but then prepends a period before ip6.arpa.

This results in a query with 2 consecutive periods, which then
goes on to fail query validation and so the query is never sent.

I have no idea how this failed basic quality testing especially
since there is an example program that uses this functionality
that was apparently not even extended to try IPv6.

src/libmowgli/dns/evloop_res.c

index d9ccaa1e46b29ea3058f4fd4c8810ad8b49af8c9..2432ee12dbe19b3d498149fbc18440960e70ce23 100644 (file)
@@ -713,7 +713,7 @@ do_query_number(mowgli_dns_t *dns, mowgli_dns_query_t *query, const struct socka
                                (unsigned int) (cp[i] & 0xf),
                                (unsigned int) (cp[i] >> 4));
 
-               strcpy(rqptr, ".ip6.arpa");
+               strcpy(rqptr, "ip6.arpa");
        }
        else
        {