move rdata_buffer to cache_answer()
authorFelix Fietkau <nbd@openwrt.org>
Mon, 9 Jun 2014 19:46:25 +0000 (21:46 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 9 Jun 2014 19:46:25 +0000 (21:46 +0200)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
cache.c
dns.c
dns.h

diff --git a/cache.c b/cache.c
index 4dcccfb..c49b0fd 100644 (file)
--- a/cache.c
+++ b/cache.c
@@ -227,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;
 
diff --git a/dns.c b/dns.c
index c1c2803..4951774 100644 (file)
--- a/dns.c
+++ b/dns.c
@@ -39,7 +39,6 @@
 #include "service.h"
 #include "interface.h"
 
-char rdata_buffer[MAX_DATA_LEN + 1];
 static char name_buffer[MAX_NAME_LEN + 1];
 
 const char*
diff --git a/dns.h b/dns.h
index 59ba636..ba34a85 100644 (file)
--- a/dns.h
+++ b/dns.h
@@ -68,8 +68,6 @@ struct dns_question {
 
 struct interface;
 
-extern char rdata_buffer[MAX_DATA_LEN + 1];
-
 void dns_send_question(struct interface *iface, const char *question, int type);
 void dns_init_answer(void);
 void dns_add_answer(int type, const uint8_t *rdata, uint16_t rdlength);