}
auto dc = std::make_unique<DNSComboWriter>(question, g_now, std::move(policyTags), t_pdl, std::move(data), std::move(records));
+
+ if (SyncRes::isUnsupported(dc->d_mdp.d_qtype)) {
+ g_stats.ignoredCount++;
+ if (!g_quiet) {
+ g_log << Logger::Notice << RecThreadInfo::id() << " Unsupported qtype " << dc->d_mdp.d_qtype << " from " << source.toStringWithPort() << (source != fromaddr ? " (via " + fromaddr.toStringWithPort() + ")" : "") << endl;
+ }
+
+ return 0;
+ }
+
dc->setSocket(fd);
dc->d_tag = ctag;
dc->d_qhash = qhash;
void pushAlmostExpiredTask(const DNSName& qname, uint16_t qtype, time_t deadline)
{
- switch (qtype) {
- // Internal types
- case QType::ENT:
- case QType::ADDR:
- case QType::ALIAS:
- case QType::LUA:
- g_log << Logger::Debug << "Cannot push task for " << QType(qtype).toString() << endl;
+ if (SyncRes::isUnsupported(qtype)) {
+ g_log << Logger::Error << "Cannot push task for " << QType(qtype).toString() << endl;
return;
}
pdns::ResolveTask task{qname, qtype, deadline, true, resolve};
}
return;
}
+ if (SyncRes::isUnsupported(dc->d_mdp.d_qtype)) {
+ g_stats.ignoredCount++;
+ if (g_logCommonErrors) {
+ g_log << Logger::Error << "Unsupported qtype " << dc->d_mdp.d_qtype << " from TCP client " << conn->d_remote.toStringWithPort() << endl;
+ }
+ return;
+ }
+
dc->d_tcpConnection = conn; // carry the torch
dc->setSocket(conn->getFD()); // this is the only time a copy is made of the actual fd
dc->d_tcp = true;
d_queryReceivedOverTCP = tcp;
}
+ static bool isUnsupported(QType qtype)
+ {
+ switch (qtype.getCode()) {
+ // Internal types
+ case QType::ENT:
+ case QType::ADDR:
+ case QType::ALIAS:
+ case QType::LUA:
+ return true;
+ }
+ return false;
+ }
+
static thread_local ThreadLocalStorage t_sstorage;
static pdns::stat_t s_queries;