move rdata_buffer to cache_answer()
[project/mdnsd.git] / cache.c
diff --git a/cache.c b/cache.c
index 123925a..c49b0fd 100644 (file)
--- a/cache.c
+++ b/cache.c
@@ -116,10 +116,12 @@ void cache_cleanup(void)
 void
 cache_scan(void)
 {
 void
 cache_scan(void)
 {
+       struct interface *iface;
        struct cache_entry *s;
 
        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*
 }
 
 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;
 
        void *rdata_ptr, *txt_ptr;
        int host_len = 0;
 
+       static char rdata_buffer[MAX_DATA_LEN + 1];
+
        if (!(a->class & CLASS_IN))
                return;
 
        if (!(a->class & CLASS_IN))
                return;