From: Otto Moerbeek Date: Tue, 16 Jul 2019 08:07:07 +0000 (+0200) Subject: Merge remote-tracking branch 'origin/master' into errno-review X-Git-Tag: dnsdist-1.4.0-rc3~39^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=de1e90549ac4010da7e404810dc9a01b6f025c49;p=pdns Merge remote-tracking branch 'origin/master' into errno-review --- de1e90549ac4010da7e404810dc9a01b6f025c49 diff --cc pdns/dnsproxy.cc index 017a59b03,eafc6663e..e2fad5ff8 --- a/pdns/dnsproxy.cc +++ b/pdns/dnsproxy.cc @@@ -283,12 -284,11 +283,12 @@@ void DNSProxy::mainloop(void msgh.msg_control=NULL; if(i->second.anyLocal) { - addCMsgSrcAddr(&msgh, cbuf, i->second.anyLocal.get_ptr(), 0); + addCMsgSrcAddr(&msgh, &cbuf, i->second.anyLocal.get_ptr(), 0); } - if(sendmsg(i->second.outsock, &msgh, 0) < 0) - g_log<second.outsock, &msgh, 0) < 0) { + int err = errno; + g_log<second.created=0; } } diff --cc pdns/pdns_recursor.cc index 71f054a13,03e7c0523..7e41abe8e --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@@ -1664,13 -1666,10 +1671,13 @@@ static void startDoResolve(void *p msgh.msg_control=NULL; if(g_fromtosockets.count(dc->d_socket)) { - addCMsgSrcAddr(&msgh, cbuf, &dc->d_local, 0); + addCMsgSrcAddr(&msgh, &cbuf, &dc->d_local, 0); } - if(sendmsg(dc->d_socket, &msgh, 0) < 0 && g_logCommonErrors) - g_log<getRemote()<<" failed with: "<d_socket, &msgh, 0) < 0 && g_logCommonErrors) { + int err = errno; + g_log << Logger::Warning << "Sending UDP reply to client " << dc->getRemote() << " failed with: " + << strerror(err) << endl; + } if(variableAnswer || sr.wasVariable()) { g_stats.variableResponses++; @@@ -2327,14 -2329,11 +2338,14 @@@ static string* doProcessUDPQuestion(con msgh.msg_control=NULL; if(g_fromtosockets.count(fd)) { - addCMsgSrcAddr(&msgh, cbuf, &destaddr, 0); + addCMsgSrcAddr(&msgh, &cbuf, &destaddr, 0); } - if(sendmsg(fd, &msgh, 0) < 0 && g_logCommonErrors) - g_log<= sizeof(struct dnsheader)) { struct dnsheader tmpdh; memcpy(&tmpdh, response.c_str(), sizeof(tmpdh));