- avl_for_each_element_safe(&records, r, avl, p)
- if (cache_is_expired(r->time, r->ttl, 100))
+ avl_for_each_element_safe(&records, r, avl, p) {
+ if (!cache_is_expired(r->time, r->ttl, r->refresh))
+ continue;
+ /* Records other than A(AAA) are handled as services */
+ if (r->type != TYPE_A && r->type != TYPE_AAAA) {
+ if (cache_is_expired(r->time, r->ttl, 100))
+ cache_record_free(r);
+ continue;
+ }
+ if (r->refresh >= 100) {