if (!doTCP) {
int queryfd;
try {
- ret = asendto(vpacket.data(), vpacket.size(), 0, address, addressToBindTo, qid, domain, type, subnetOpts, &queryfd, *now);
+ ret = asendto(vpacket.data(), vpacket.size(), address, addressToBindTo, qid, domain, type, subnetOpts, &queryfd, *now);
}
catch (const PDNSException& e) {
if (addressToBindTo) {
}
// sleep until we see an answer to this, interface to mtasker
- ret = arecvfrom(buf, 0, address, len, qid, domain, type, queryfd, subnetOpts, *now);
+ ret = arecvfrom(buf, address, len, qid, domain, type, queryfd, subnetOpts, *now);
}
else {
bool isNew{};
"onwire", Logging::Loggable(mdp.d_qname));
}
// unexpected count has already been done @ pdns_recursor.cc
- goto out;
+ if (!lwr->d_rcode) {
+ lwr->d_rcode = RCode::ServFail;
+ }
+ return LWResult::Result::PermanentError;
}
lwr->d_records.reserve(mdp.d_answers.size());
t_Counters.at(rec::Counter::serverParseError)++;
-out:
if (!lwr->d_rcode) {
lwr->d_rcode = RCode::ServFail;
}
class EDNSSubnetOpts;
-LWResult::Result asendto(const void* data, size_t len, int flags, const ComboAddress& toAddress,
+LWResult::Result asendto(const void* data, size_t len, const ComboAddress& toAddress,
std::optional<ComboAddress>& localAddress, uint16_t qid,
const DNSName& domain, uint16_t qtype, const std::optional<EDNSSubnetOpts>& ecs, int* fileDesc, timeval& now);
-LWResult::Result arecvfrom(PacketBuffer& packet, int flags, const ComboAddress& fromAddr, size_t& len, uint16_t qid,
+LWResult::Result arecvfrom(PacketBuffer& packet, const ComboAddress& fromAddr, size_t& len, uint16_t qid,
const DNSName& domain, uint16_t qtype, int fileDesc, const std::optional<EDNSSubnetOpts>& ecs, const struct timeval& now);
LWResult::Result asyncresolve(const OptLog& log, const ComboAddress& address, const DNSName& domain, int type, bool doTCP, bool sendRDQuery, int EDNS0Level, struct timeval* now, std::optional<Netmask>& srcmask, const ResolveContext& context, const std::shared_ptr<std::vector<std::unique_ptr<RemoteLogger>>>& outgoingLoggers, const std::shared_ptr<std::vector<std::unique_ptr<FrameStreamLogger>>>& fstrmLoggers, const std::set<uint16_t>& exportTypes, LWResult* lwr, bool* chained);
}
/* these two functions are used by LWRes */
-LWResult::Result asendto(const void* data, size_t len, int /* flags */,
+LWResult::Result asendto(const void* data, size_t len,
const ComboAddress& toAddress, std::optional<ComboAddress>& localAddress, uint16_t qid, const DNSName& domain, uint16_t qtype, const std::optional<EDNSSubnetOpts>& ecs, int* fileDesc, timeval& now)
{
t_fdm->addReadFD(*fileDesc, handleUDPServerResponse, pident);
ssize_t sent = send(*fileDesc, data, len, 0);
-
- int tmp = errno;
-
if (sent < 0) {
+ int tmp = errno;
t_udpclientsocks->returnSocket(*fileDesc);
errno = tmp; // this is for logging purposes only
return LWResult::Result::PermanentError;
static bool checkIncomingECSSource(const PacketBuffer& packet, const Netmask& subnet);
-LWResult::Result arecvfrom(PacketBuffer& packet, int /* flags */, const ComboAddress& fromAddr, size_t& len,
+LWResult::Result arecvfrom(PacketBuffer& packet, const ComboAddress& fromAddr, size_t& len,
uint16_t qid, const DNSName& domain, uint16_t qtype, int fileDesc, const std::optional<EDNSSubnetOpts>& ecs, const struct timeval& now)
{
static const unsigned int nearMissLimit = ::arg().asNum("spoof-nearmiss-max");