cache: also cache PTR records
authorSteven Barth <steven@midlink.org>
Tue, 28 Oct 2014 11:29:13 +0000 (12:29 +0100)
committerSteven Barth <steven@midlink.org>
Wed, 29 Oct 2014 15:24:14 +0000 (16:24 +0100)
Signed-off-by: Steven Barth <steven@midlink.org>
cache.c

diff --git a/cache.c b/cache.c
index 7c7a8fba52858cc573100f9d1ff8f6713722cbce..59d5b940a2e71d9ead48b32f84fedf366ca7b1c5 100644 (file)
--- a/cache.c
+++ b/cache.c
@@ -261,7 +261,10 @@ cache_answer(struct interface *iface, uint8_t *base, int blen, char *name, struc
                        host_len = rdlength - nlen - 1;
 
                cache_service(iface, rdata_buffer, host_len, a->ttl);
-               return;
+
+               dlen = strlen(rdata_buffer) + 1;
+               rdata = (uint8_t*)rdata_buffer;
+               break;
 
        case TYPE_SRV:
                if (a->rdlength < 8)