From 2c0af54faf6805e06237bef11bfcc30b005f4576 Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Fri, 10 Jun 2016 13:03:05 +0200 Subject: [PATCH] also NULL msg_control in recursor --- pdns/pdns_recursor.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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<