X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fmdnsd.git;a=blobdiff_plain;f=cache.c;h=9addc3c75b008ab9429b7b7097a0de791a67c29a;hp=123925afde4c80831600425004f258066807d483;hb=571cc214415f40ea52a98eed6b450b74be69c6f9;hpb=70ec71015a42e6e4e04b0281b80ec80e5f5f959a diff --git a/cache.c b/cache.c index 123925a..9addc3c 100644 --- a/cache.c +++ b/cache.c @@ -42,7 +42,7 @@ #include "interface.h" static struct uloop_timeout cache_gc; -struct avl_tree records, entries, hosts; +struct avl_tree records, entries; static void cache_record_free(struct cache_record *r) @@ -116,10 +116,12 @@ void cache_cleanup(void) void cache_scan(void) { + struct interface *iface; struct cache_entry *s; - avl_for_each_element(&entries, s, avl) - dns_send_question(cur_iface, s->entry, TYPE_PTR); + vlist_for_each_element(&interfaces, iface, node) + avl_for_each_element(&entries, s, avl) + dns_send_question(iface, s->entry, TYPE_PTR); } static struct cache_entry* @@ -225,6 +227,8 @@ cache_answer(struct interface *iface, uint8_t *base, int blen, char *name, struc void *rdata_ptr, *txt_ptr; int host_len = 0; + static char rdata_buffer[MAX_DATA_LEN + 1]; + if (!(a->class & CLASS_IN)) return;