[LEDE-DEV] [PATCH mdns] Use A(AAA) when querying for domain on cache expire

Rafał Miłecki zajec5 at gmail.com
Tue Feb 14 04:55:46 PST 2017


From: Rafał Miłecki <rafal at milecki.pl>

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 at milecki.pl>
---
 cache.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/cache.c b/cache.c
index dd263d2..756ae68 100644
--- 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);
-- 
2.11.0




More information about the Lede-dev mailing list