From: Rafał Miłecki Date: Mon, 20 Mar 2017 16:55:50 +0000 (+0100) Subject: Fix code freeing cached non-A(AAA) records too early X-Git-Url: http://git.openwrt.org/?p=project%2Fmdnsd.git;a=commitdiff_plain;h=1478293fd95f29f16887c5e6554035cd38d4b2d7 Fix code freeing cached non-A(AAA) records too early Fixes: f89986b67dd5 ("Fix refreshing cached A(AAA) records that expire") Signed-off-by: Rafał Miłecki --- diff --git a/cache.c b/cache.c index 6ff2479..0658e7e 100644 --- a/cache.c +++ b/cache.c @@ -80,7 +80,8 @@ cache_gc_timer(struct uloop_timeout *timeout) continue; /* Records other than A(AAA) are handled as services */ if (r->type != TYPE_A && r->type != TYPE_AAAA) { - cache_record_free(r); + if (cache_is_expired(r->time, r->ttl, 100)) + cache_record_free(r); continue; } if (r->refresh >= 100) {