continue;
}
s->refresh += 50;
- dns_send_question(s->iface, s->entry, TYPE_PTR, 1);
+ 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);
}
void
-cache_scan(void)
+cache_update(void)
{
struct interface *iface;
struct cache_service *s;
vlist_for_each_element(&interfaces, iface, node)
avl_for_each_element(&services, s, avl)
- dns_send_question(iface, s->entry, TYPE_PTR, 1);
+ dns_send_question(iface, s->entry, TYPE_PTR, 0);
}
static struct cache_service*
if (!strcmp(s->entry, entry)) {
s->refresh = 50;
s->time = monotonic_time();
+ s->ttl = ttl;
return s;
}
avl_insert(&services, &s->avl);
if (!hlen)
- dns_send_question(iface, entry, TYPE_PTR, !iface->multicast);
+ dns_send_question(iface, entry, TYPE_PTR, iface->multicast);
return s;
}