X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fmdnsd.git;a=blobdiff_plain;f=dns.c;h=5595384a544b0f86ba326629defd27a47c2a3b27;hp=6389f8cc15e4ae64d5a5aae557fc2535001bc283;hb=2ef1a8ff170ea2c81b3523283dfbc1567297a839;hpb=6585bb9209c56d1653c0527ed5b7de4a6279b7bb diff --git a/dns.c b/dns.c index 6389f8c..5595384 100644 --- a/dns.c +++ b/dns.c @@ -69,7 +69,6 @@ void dns_send_question(struct uloop_fd *u, char *question, int type) { static size_t cmsg_data[( CMSG_SPACE(sizeof(struct in_pktinfo)) / sizeof(size_t)) + 1]; - static unsigned char buffer[MAX_NAME_LEN]; static struct dns_header h = { .questions = cpu_to_be16(1), }; @@ -82,7 +81,7 @@ dns_send_question(struct uloop_fd *u, char *question, int type) .iov_len = sizeof(h), }, { - .iov_base = buffer, + .iov_base = name_buffer, }, { .iov_base = &q, @@ -108,7 +107,7 @@ dns_send_question(struct uloop_fd *u, char *question, int type) a.sin_addr.s_addr = inet_addr(MCAST_ADDR); q.type = __cpu_to_be16(type); - len = dn_comp(question, buffer, MAX_NAME_LEN, NULL, NULL); + len = dn_comp(question, (void *) name_buffer, sizeof(name_buffer), NULL, NULL); if (len < 1) return;