Use A(AAA) when querying for domain on cache expire
authorRafał Miłecki <rafal@milecki.pl>
Tue, 14 Feb 2017 12:55:46 +0000 (13:55 +0100)
committerRafał Miłecki <rafal@milecki.pl>
Wed, 15 Feb 2017 10:15:10 +0000 (11:15 +0100)
When cache entry is (halfly) expired we send query to get an update. So
far we were sending all queries using PTR records but for cached domains
it should be A(AAA) instead.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: John Crispin <john@phrozen.org>
cache.c

diff --git a/cache.c b/cache.c
index dd263d204272d86f49203993ff9d4a8d2c7cb5a0..756ae6859983c16653ddb7b26ca20101e72e57bb 100644 (file)
--- a/cache.c
+++ b/cache.c
@@ -89,7 +89,12 @@ cache_gc_timer(struct uloop_timeout *timeout)
                        continue;
                }
                s->refresh += 50;
-               dns_send_question(s->iface, s->entry, TYPE_PTR, 0);
+               if (cache_service_is_host(s)) {
+                       dns_send_question(s->iface, s->entry, TYPE_A, 0);
+                       dns_send_question(s->iface, s->entry, TYPE_AAAA, 0);
+               } else {
+                       dns_send_question(s->iface, s->entry, TYPE_PTR, 0);
+               }
        }
 
        uloop_timeout_set(timeout, 10000);