]> granicus.if.org Git - pdns/commitdiff
also NULL msg_control in recursor
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Fri, 10 Jun 2016 11:03:05 +0000 (13:03 +0200)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Fri, 10 Jun 2016 11:03:05 +0000 (13:03 +0200)
pdns/pdns_recursor.cc

index c64261c8c1cc2821b7458b2fd589f031764847c1..3042a2a9d1bb00124c45dfa58e7bbc0006b77b53 100644 (file)
@@ -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<<Logger::Warning<<"Sending UDP reply to client "<<dc->d_remote.toStringWithPort()<<" failed with: "<<strerror(errno)<<endl;
       if(!SyncRes::s_nopacketcache && !variableAnswer && !sr.wasVariable() ) {
@@ -1406,12 +1407,11 @@ string* doProcessUDPQuestion(const std::string& question, const ComboAddress& fr
       struct iovec iov;
       char cbuf[256];
       fillMSGHdr(&msgh, &iov, cbuf, 0, (char*)response.c_str(), response.length(), const_cast<ComboAddress*>(&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<<Logger::Warning<<"Sending UDP reply to client "<<fromaddr.toStringWithPort()<<" failed with: "<<strerror(errno)<<endl;