remove unused avl tree hosts
[project/mdnsd.git] / cache.c
diff --git a/cache.c b/cache.c
index 123925a..9addc3c 100644 (file)
--- 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;