From a8d711b83280b2b61e3043b4a8b27f9f7530bbe7 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 18 Apr 2013 09:36:41 +0200 Subject: [PATCH] Use correct reply size in DNS packets --- dns.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dns.c b/dns.c index 218f1e5..b01196c 100644 --- a/dns.c +++ b/dns.c @@ -430,8 +430,10 @@ int dnsserver(dns_opt_t *opt) { if (hdr->cmsg_level == IPPROTO_IP && hdr->cmsg_type == DSTADDR_SOCKOPT) { msg.msg_iov[0].iov_base = outbuf; + msg.msg_iov[0].iov_len = ret; sendmsg(listenSocket, &msg, 0); msg.msg_iov[0].iov_base = inbuf; + msg.msg_iov[0].iov_len = sizeof(inbuf); handled = true; } }