Use correct reply size in DNS packets

This commit is contained in:
Pieter Wuille 2013-04-18 09:36:41 +02:00
parent b735e5f1ff
commit a8d711b832

2
dns.c
View file

@ -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;
}
}