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 4dcccfb8b20ff0050ea82840ef3e04830963f900..c49b0fda38033eaf4adaaa900831cdecdc9daede 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 c1c280341449331bcf39d1efb0d0ba59692d4246..495177412fdbd2a38a1043ca2d61c29e4c16b145 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 59ba6361d0d6cc6be1dc012f047bea6e8b9b4877..ba34a8589bc2f57d1f68c2fd73dc1ceaa7df98c0 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);