From: Peter van Dijk Date: Fri, 10 Jun 2016 11:03:05 +0000 (+0200) Subject: also NULL msg_control in recursor X-Git-Tag: auth-4.0.0-rc1~2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c0af54faf6805e06237bef11bfcc30b005f4576;p=thirdparty%2Fpdns.git also NULL msg_control in recursor --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index c64261c8c1..3042a2a9d1 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -1050,10 +1050,11 @@ void startDoResolve(void *p) struct iovec iov; char cbuf[256]; fillMSGHdr(&msgh, &iov, cbuf, 0, (char*)&*packet.begin(), packet.size(), &dc->d_remote); + msgh.msg_control=NULL; + if(g_fromtosockets.count(dc->d_socket)) { addCMsgSrcAddr(&msgh, cbuf, &dc->d_local, 0); - } else - msgh.msg_control=NULL; + } if(sendmsg(dc->d_socket, &msgh, 0) < 0 && g_logCommonErrors) L<d_remote.toStringWithPort()<<" failed with: "<(&fromaddr)); + msgh.msg_control=NULL; + if(g_fromtosockets.count(fd)) { addCMsgSrcAddr(&msgh, cbuf, &destaddr, 0); } - else { - msgh.msg_control=NULL; - } if(sendmsg(fd, &msgh, 0) < 0 && g_logCommonErrors) L<