vlist_for_each_element(&interfaces, iface, node)
avl_for_each_element(&entries, s, avl)
- dns_send_question(iface, s->entry, TYPE_PTR);
+ dns_send_question(iface, s->entry, TYPE_PTR, 1);
}
static struct cache_entry*
avl_insert(&entries, &s->avl);
if (!hlen)
- dns_send_question(iface, entry, TYPE_PTR);
+ dns_send_question(iface, entry, TYPE_PTR, !iface->multicast);
return s;
}
if (!l)
return NULL;
- while (l && !strcmp(l->record, record)) {
+ while (l && l->record && !strcmp(l->record, record)) {
struct cache_record *r = l;
l = avl_next_element(l, avl);
uint8_t v = *p;
*p = '\0';
- if (v)
+ if (v && p + v < &rdata_buffer[rdlength])
p += v + 1;
} while (*p);
break;
if (r) {
if (!a->ttl) {
DBG(1, "D -> %s %s ttl:%d\n", dns_type_string(r->type), r->record, r->ttl);
- cache_record_free(r);
+ r->time = time(0) + 1 - r->ttl;
} else {
r->ttl = a->ttl;
DBG(1, "A -> %s %s ttl:%d\n", dns_type_string(r->type), r->record, r->ttl);