Skip to content

Commit

Permalink
auth: on OpenBSD, try harder to send on a non-blocking socket
Browse files Browse the repository at this point in the history
Should fix #13857 in many cases, though you can still argue this
is a OpenBSD bug (or at least an undesirable difference between other
systems and OpenBSD).
  • Loading branch information
omoerbeek committed Mar 6, 2024
1 parent d7c64f9 commit 24aba96
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pdns/nameserver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,10 @@ void UDPNameserver::send(DNSPacket& p)
if(buffer.length() > p.getMaxReplyLen()) {
g_log<<Logger::Error<<"Weird, trying to send a message that needs truncation, "<< buffer.length()<<" > "<<p.getMaxReplyLen()<<". Question was for "<<p.qdomain<<"|"<<p.qtype.toString()<<endl;
}
if(sendmsg(p.getSocket(), &msgh, 0) < 0)
g_log<<Logger::Error<<"Error sending reply with sendmsg (socket="<<p.getSocket()<<", dest="<<p.d_remote.toStringWithPort()<<"): "<<stringerror()<<endl;
if (sendOnNBSocket(p.getSocket(), &msgh) < 0) {
int err = errno;
g_log<<Logger::Error<<"Error sending reply with sendmsg (socket="<<p.getSocket()<<", dest="<<p.d_remote.toStringWithPort()<<"): "<<stringerror(err)<<endl;
}
}

bool UDPNameserver::receive(DNSPacket& packet, std::string& buffer)
Expand Down

0 comments on commit 24aba96

Please sign in to comment.