/*
- * Copyright (C) 1996-2019 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
/* DEBUG: section 78 DNS lookups; interacts with dns/rfc1035.cc */
#include "squid.h"
+#include "base/CodeContext.h"
#include "base/InstanceId.h"
+#include "base/IoManip.h"
+#include "base/Random.h"
#include "base/RunnersRegistry.h"
#include "comm.h"
#include "comm/Connection.h"
#include "comm/Loops.h"
#include "comm/Read.h"
#include "comm/Write.h"
+#include "debug/Messages.h"
#include "dlink.h"
#include "dns/forward.h"
#include "dns/rfc3596.h"
#include "ip/tools.h"
#include "MemBuf.h"
#include "mgr/Registration.h"
+#include "snmp_agent.h"
#include "SquidConfig.h"
-#include "SquidTime.h"
#include "Store.h"
#include "tools.h"
#include "util.h"
#include <arpa/nameser.h>
#endif
#include <cerrno>
-#include <random>
#if HAVE_RESOLV_H
#include <resolv.h>
#endif
CBDATA_CLASS(idns_query);
public:
- idns_query() {
+ idns_query():
+ codeContext(CodeContext::Current())
+ {
callback = nullptr;
memset(&query, 0, sizeof(query));
*buf = 0;
struct timeval sent_t;
struct timeval queue_t;
dlink_node lru;
+
IDNSCB *callback;
void *callback_data = nullptr;
+ CodeContext::Pointer codeContext; ///< requestor's context
+
int attempt = 0;
int rcode = 0;
idns_query *queue = nullptr;
{
public:
/* RegisteredRunner API */
- virtual void startReconfigure() override;
- virtual void endingShutdown() override;
+ void startReconfigure() override;
+ void endingShutdown() override;
};
-RunnerRegistrationEntry(ConfigRr);
-
} // namespace Dns
+DefineRunnerRegistratorIn(Dns, ConfigRr);
+
struct _sp {
char domain[NS_MAXDNAME];
int queries;
};
static std::vector<ns> nameservers;
-static sp *searchpath = NULL;
+static sp *searchpath = nullptr;
static int nns_mdns_count = 0;
static int npc = 0;
static int npc_alloc = 0;
static int ndots = 1;
static dlink_list lru_list;
static int event_queued = 0;
-static hash_table *idns_lookup_hash = NULL;
+static hash_table *idns_lookup_hash = nullptr;
/*
* Notes on EDNS:
return;
}
- nameservers.emplace_back(ns());
+ auto &nameserver = nameservers.emplace_back(ns());
A.port(NS_DEFAULTPORT);
- nameservers.back().S = A;
+ nameserver.S = A;
#if WHEN_EDNS_RESPONSES_ARE_PARSED
- nameservers.back().last_seen_edns = RFC1035_DEFAULT_PACKET_SZ;
+ nameserver.last_seen_edns = RFC1035_DEFAULT_PACKET_SZ;
// TODO generate a test packet to probe this NS from EDNS size and ability.
#endif
debugs(78, 3, "Added nameserver #" << nameservers.size()-1 << " (" << A << ")");
{
bool result = false;
for (auto &i : Config.dns.nameservers) {
- debugs(78, DBG_IMPORTANT, "Adding nameserver " << i << " from squid.conf");
+ debugs(78, Important(15), "Adding nameserver " << i << " from squid.conf");
idnsAddNameserver(i.c_str());
result = true;
}
}
char buf[RESOLV_BUFSZ];
- const char *t = NULL;
+ const char *t = nullptr;
while (fgets(buf, RESOLV_BUFSZ, fp)) {
t = strtok(buf, w_space);
- if (NULL == t) {
+ if (nullptr == t) {
continue;
} else if (strcmp(t, "nameserver") == 0) {
- t = strtok(NULL, w_space);
+ t = strtok(nullptr, w_space);
- if (NULL == t)
+ if (nullptr == t)
continue;
debugs(78, DBG_IMPORTANT, "Adding nameserver " << t << " from " << _PATH_RESCONF);
result = true;
} else if (strcmp(t, "domain") == 0) {
idnsFreeSearchpath();
- t = strtok(NULL, w_space);
+ t = strtok(nullptr, w_space);
- if (NULL == t)
+ if (nullptr == t)
continue;
debugs(78, DBG_IMPORTANT, "Adding domain " << t << " from " << _PATH_RESCONF);
idnsAddPathComponent(t);
} else if (strcmp(t, "search") == 0) {
idnsFreeSearchpath();
- while (NULL != t) {
- t = strtok(NULL, w_space);
+ while (nullptr != t) {
+ t = strtok(nullptr, w_space);
- if (NULL == t)
+ if (nullptr == t)
continue;
debugs(78, DBG_IMPORTANT, "Adding domain " << t << " from " << _PATH_RESCONF);
idnsAddPathComponent(t);
}
} else if (strcmp(t, "options") == 0) {
- while (NULL != t) {
- t = strtok(NULL, w_space);
+ while (nullptr != t) {
+ t = strtok(nullptr, w_space);
- if (NULL == t)
+ if (nullptr == t)
continue;
if (strncmp(t, "ndots:", 6) == 0) {
DWORD Type = 0;
DWORD Size = 0;
LONG Result;
- Result = RegQueryValueEx(hndKey, "Domain", NULL, &Type, NULL, &Size);
+ Result = RegQueryValueEx(hndKey, "Domain", nullptr, &Type, nullptr, &Size);
if (Result == ERROR_SUCCESS && Size) {
t = (char *) xmalloc(Size);
- RegQueryValueEx(hndKey, "Domain", NULL, &Type, (LPBYTE) t, &Size);
+ RegQueryValueEx(hndKey, "Domain", nullptr, &Type, (LPBYTE) t, &Size);
debugs(78, DBG_IMPORTANT, "Adding domain " << t << " from Registry");
idnsAddPathComponent(t);
xfree(t);
}
- Result = RegQueryValueEx(hndKey, "SearchList", NULL, &Type, NULL, &Size);
+ Result = RegQueryValueEx(hndKey, "SearchList", nullptr, &Type, nullptr, &Size);
if (Result == ERROR_SUCCESS && Size) {
t = (char *) xmalloc(Size);
- RegQueryValueEx(hndKey, "SearchList", NULL, &Type, (LPBYTE) t, &Size);
+ RegQueryValueEx(hndKey, "SearchList", nullptr, &Type, (LPBYTE) t, &Size);
token = strtok(t, Separator);
while (token) {
idnsAddPathComponent(token);
debugs(78, DBG_IMPORTANT, "Adding domain " << token << " from Registry");
- token = strtok(NULL, Separator);
+ token = strtok(nullptr, Separator);
}
xfree(t);
}
DWORD Type = 0;
DWORD Size = 0;
LONG Result;
- Result = RegQueryValueEx(hndKey, "DhcpNameServer", NULL, &Type, NULL, &Size);
+ Result = RegQueryValueEx(hndKey, "DhcpNameServer", nullptr, &Type, nullptr, &Size);
if (Result == ERROR_SUCCESS && Size) {
t = (char *) xmalloc(Size);
- RegQueryValueEx(hndKey, "DhcpNameServer", NULL, &Type, (LPBYTE) t, &Size);
+ RegQueryValueEx(hndKey, "DhcpNameServer", nullptr, &Type, (LPBYTE) t, &Size);
token = strtok(t, ", ");
while (token) {
idnsAddNameserver(token);
result = true;
debugs(78, DBG_IMPORTANT, "Adding DHCP nameserver " << token << " from Registry");
- token = strtok(NULL, ",");
+ token = strtok(nullptr, ",");
}
xfree(t);
}
- Result = RegQueryValueEx(hndKey, "NameServer", NULL, &Type, NULL, &Size);
+ Result = RegQueryValueEx(hndKey, "NameServer", nullptr, &Type, nullptr, &Size);
if (Result == ERROR_SUCCESS && Size) {
t = (char *) xmalloc(Size);
- RegQueryValueEx(hndKey, "NameServer", NULL, &Type, (LPBYTE) t, &Size);
+ RegQueryValueEx(hndKey, "NameServer", nullptr, &Type, (LPBYTE) t, &Size);
token = strtok(t, ", ");
while (token) {
debugs(78, DBG_IMPORTANT, "Adding nameserver " << token << " from Registry");
idnsAddNameserver(token);
result = true;
- token = strtok(NULL, ", ");
+ token = strtok(nullptr, ", ");
}
xfree(t);
}
char *keyname;
FILETIME ftLastWriteTime;
- if (RegQueryInfoKey(hndKey, NULL, NULL, NULL, &InterfacesCount, &MaxSubkeyLen, NULL, NULL, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) {
+ if (RegQueryInfoKey(hndKey, nullptr, nullptr, nullptr, &InterfacesCount, &MaxSubkeyLen, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr) == ERROR_SUCCESS) {
keyname = (char *) xmalloc(++MaxSubkeyLen);
for (i = 0; i < (int) InterfacesCount; ++i) {
DWORD j;
j = MaxSubkeyLen;
- if (RegEnumKeyEx(hndKey, i, keyname, &j, NULL, NULL, NULL, &ftLastWriteTime) == ERROR_SUCCESS) {
+ if (RegEnumKeyEx(hndKey, i, keyname, &j, nullptr, nullptr, nullptr, &ftLastWriteTime) == ERROR_SUCCESS) {
char *newkeyname;
newkeyname = (char *) xmalloc(sizeof(REG_TCPIP_PARA_INTERFACES) + j + 2);
strcpy(newkeyname, REG_TCPIP_PARA_INTERFACES);
DWORD Type = 0;
DWORD Size = 0;
LONG Result;
- Result = RegQueryValueEx(hndKey2, "DhcpNameServer", NULL, &Type, NULL, &Size);
+ Result = RegQueryValueEx(hndKey2, "DhcpNameServer", nullptr, &Type, nullptr, &Size);
if (Result == ERROR_SUCCESS && Size) {
t = (char *) xmalloc(Size);
- RegQueryValueEx(hndKey2, "DhcpNameServer", NULL, &Type, (LPBYTE)t, &Size);
+ RegQueryValueEx(hndKey2, "DhcpNameServer", nullptr, &Type, (LPBYTE)t, &Size);
token = strtok(t, ", ");
while (token) {
debugs(78, DBG_IMPORTANT, "Adding DHCP nameserver " << token << " from Registry");
idnsAddNameserver(token);
result = true;
- token = strtok(NULL, ", ");
+ token = strtok(nullptr, ", ");
}
xfree(t);
}
- Result = RegQueryValueEx(hndKey2, "NameServer", NULL, &Type, NULL, &Size);
+ Result = RegQueryValueEx(hndKey2, "NameServer", nullptr, &Type, nullptr, &Size);
if (Result == ERROR_SUCCESS && Size) {
t = (char *) xmalloc(Size);
- RegQueryValueEx(hndKey2, "NameServer", NULL, &Type, (LPBYTE)t, &Size);
+ RegQueryValueEx(hndKey2, "NameServer", nullptr, &Type, (LPBYTE)t, &Size);
token = strtok(t, ", ");
while (token) {
debugs(78, DBG_IMPORTANT, "Adding nameserver " << token << " from Registry");
idnsAddNameserver(token);
result = true;
- token = strtok(NULL, ", ");
+ token = strtok(nullptr, ", ");
}
xfree(t);
DWORD Type = 0;
DWORD Size = 0;
LONG Result;
- Result = RegQueryValueEx(hndKey, "NameServer", NULL, &Type, NULL, &Size);
+ Result = RegQueryValueEx(hndKey, "NameServer", nullptr, &Type, nullptr, &Size);
if (Result == ERROR_SUCCESS && Size) {
t = (char *) xmalloc(Size);
- RegQueryValueEx(hndKey, "NameServer", NULL, &Type, (LPBYTE) t, &Size);
+ RegQueryValueEx(hndKey, "NameServer", nullptr, &Type, (LPBYTE) t, &Size);
token = strtok(t, ", ");
while (token) {
debugs(78, DBG_IMPORTANT, "Adding nameserver " << token << " from Registry");
idnsAddNameserver(token);
result = true;
- token = strtok(NULL, ", ");
+ token = strtok(nullptr, ", ");
}
xfree(t);
}
break;
default:
- debugs(78, DBG_IMPORTANT, "Failed to read nameserver from Registry: Unknown System Type.");
+ debugs(78, DBG_IMPORTANT, "ERROR: Failed to read nameserver from Registry: Unknown System Type.");
}
return result;
if (event_queued)
return;
- if (NULL == lru_list.tail)
+ if (nullptr == lru_list.tail)
return;
const double when = min(Config.Timeout.idns_query, Config.Timeout.idns_retransmit)/1000.0;
- eventAdd("idnsCheckQueue", idnsCheckQueue, NULL, when, 1);
+ eventAdd("idnsCheckQueue", idnsCheckQueue, nullptr, when, 1);
event_queued = 1;
}
vc->busy = 1;
// Comm needs seconds but idnsCheckQueue() will check the exact timeout
- const int timeout = (Config.Timeout.idns_query % 1000 ?
- Config.Timeout.idns_query + 1000 : Config.Timeout.idns_query) / 1000;
+ const auto timeout = (Config.Timeout.idns_query % 1000 ?
+ Config.Timeout.idns_query + 1000 : Config.Timeout.idns_query) / 1000;
AsyncCall::Pointer nil;
commSetConnTimeout(vc->conn, timeout, nil);
char buf[MAX_IPSTRLEN] = "";
if (vc->ns < nameservers.size())
nameservers[vc->ns].S.toStr(buf,MAX_IPSTRLEN);
- debugs(78, DBG_IMPORTANT, HERE << "Failed to connect to nameserver " << buf << " using TCP.");
+ debugs(78, DBG_IMPORTANT, "ERROR: Failed to connect to nameserver " << buf << " using TCP.");
return;
}
idnsVCClosed(const CommCloseCbParams ¶ms)
{
nsvc * vc = (nsvc *)params.data;
+ if (vc->conn) {
+ vc->conn->noteClosure();
+ vc->conn = nullptr;
+ }
delete vc;
}
delete queue;
delete msg;
if (ns < nameservers.size()) // XXX: idnsShutdownAndFreeState may have freed nameservers[]
- nameservers[ns].vc = NULL;
+ nameservers[ns].vc = nullptr;
}
static void
{
assert(nsv < nameservers.size());
nsvc *vc = new nsvc(nsv);
- assert(vc->conn == NULL); // MUST be NULL from the construction process!
+ assert(vc->conn == nullptr); // MUST be NULL from the construction process!
nameservers[nsv].vc = vc;
Comm::ConnectionPointer conn = new Comm::Connection();
idnsSendQueryVC(idns_query * q, size_t nsn)
{
assert(nsn < nameservers.size());
- if (nameservers[nsn].vc == NULL)
+ if (nameservers[nsn].vc == nullptr)
idnsInitVC(nsn);
nsvc *vc = nameservers[nsn].vc;
if (!vc) {
char buf[MAX_IPSTRLEN];
- debugs(78, DBG_IMPORTANT, "idnsSendQuery: Failed to initiate TCP connection to nameserver " << nameservers[nsn].S.toStr(buf,MAX_IPSTRLEN) << "!");
+ debugs(78, DBG_IMPORTANT, "ERROR: idnsSendQuery: Failed to initiate TCP connection to nameserver " << nameservers[nsn].S.toStr(buf,MAX_IPSTRLEN) << "!");
return;
}
return;
}
- assert(q->lru.next == NULL);
+ assert(q->lru.next == nullptr);
- assert(q->lru.prev == NULL);
+ assert(q->lru.prev == nullptr);
int x = -1, y = -1;
size_t nsn;
} while ( (x<0 && y<0) && q->nsends % nsCount != 0);
if (y > 0) {
- fd_bytes(DnsSocketB, y, FD_WRITE);
+ fd_bytes(DnsSocketB, y, IoDirection::Write);
}
if (x > 0) {
- fd_bytes(DnsSocketA, x, FD_WRITE);
+ fd_bytes(DnsSocketA, x, IoDirection::Write);
}
++ nameservers[nsn].nqueries;
return q;
}
- return NULL;
+ return nullptr;
}
static unsigned short
idnsQueryID()
{
// NP: apparently ranlux are faster, but not quite as "proven"
- static std::mt19937 mt(static_cast<uint32_t>(getCurrentTime() & 0xFFFFFFFF));
+ static std::mt19937 mt(RandomSeed32());
unsigned short id = mt() & 0xFFFF;
unsigned short first_id = id;
++id;
if (id == first_id) {
- debugs(78, DBG_IMPORTANT, "idnsQueryID: Warning, too many pending DNS requests");
+ debugs(78, DBG_IMPORTANT, "WARNING: idnsQueryID: too many pending DNS requests");
break;
}
}
for (auto query = master; query; query = query->slave) {
if (query->pending)
continue; // no answer yet
+ // no CallBack(CodeContext...) -- we always run in requestor's context
if (!idnsCallbackOneWithAnswer(callback, cbdata, *query, lastAnswer))
break; // the caller disappeared
}
const auto master = answered->master ? answered->master : answered;
// iterate all queued lookup callers
for (auto looker = master; looker; looker = looker->queue) {
- (void)idnsCallbackOneWithAnswer(looker->callback, looker->callback_data,
- *answered, lastAnswer);
+ CallBack(looker->codeContext, [&] {
+ (void)idnsCallbackOneWithAnswer(looker->callback, looker->callback_data,
+ *answered, lastAnswer);
+ });
}
}
static void
idnsGrokReply(const char *buf, size_t sz, int /*from_ns*/)
{
- rfc1035_message *message = NULL;
+ rfc1035_message *message = nullptr;
int n = rfc1035MessageUnpack(buf, sz, &message);
- if (message == NULL) {
- debugs(78, DBG_IMPORTANT, "idnsGrokReply: Malformed DNS response");
+ if (message == nullptr) {
+ debugs(78, DBG_IMPORTANT, "ERROR: idnsGrokReply: Malformed DNS response");
return;
}
- debugs(78, 3, "idnsGrokReply: QID 0x" << std::hex << message->id << ", " << std::dec << n << " answers");
+ debugs(78, 3, "idnsGrokReply: QID 0x" << asHex(message->id) << ", " << n << " answers");
idns_query *q = idnsFindQuery(message->id);
- if (q == NULL) {
+ if (q == nullptr) {
debugs(78, 3, "idnsGrokReply: Late response");
rfc1035MessageDestroy(&message);
return;
max_shared_edns = min(max_shared_edns, server.last_seen_edns);
} else {
nameservers[from_ns].last_seen_edns = q->edns_seen;
- // maybe reduce the global limit downwards to accomodate this NS
+ // maybe reduce the global limit downwards to accommodate this NS
max_shared_edns = min(max_shared_edns, q->edns_seen);
}
if (max_shared_edns < RFC1035_DEFAULT_PACKET_SZ)
q->pending = 0;
if (message->tc) {
- debugs(78, 3, HERE << "Resolver requested TC (" << q->query.name << ")");
+ debugs(78, 3, "Resolver requested TC (" << q->query.name << ")");
rfc1035MessageDestroy(&message);
if (!q->need_vc) {
} else {
// Strange: A TCP DNS response with the truncation bit (TC) set.
// Return an error and cleanup; no point in trying TCP again.
- debugs(78, 3, HERE << "TCP DNS response");
+ debugs(78, 3, "TCP DNS response");
idnsCallback(q, "Truncated TCP DNS response");
}
}
// Do searchpath processing on the master A query only to keep
- // things simple. NXDOMAIN is authorative for the label, not
+ // things simple. NXDOMAIN is authoritative for the label, not
// the record type.
if (q->rcode == 3 && !q->master && q->do_searchpath && q->attempt < MAX_ATTEMPT) {
- assert(NULL == message->answer);
+ assert(nullptr == message->answer);
strcpy(q->name, q->orig);
debugs(78, 3, "idnsGrokReply: Query result: NXDOMAIN - " << q->name );
while (idns_query *slave = q->slave) {
dlinkDelete(&slave->lru, &lru_list);
q->slave = slave->slave;
- slave->slave = NULL;
+ slave->slave = nullptr;
delete slave;
}
q->ancount = n;
if (n >= 0)
- idnsCallback(q, NULL);
+ idnsCallback(q, nullptr);
else
idnsCallback(q, rfc1035ErrorMessage(q->rcode));
// Always keep reading. This stops (or at least makes harder) several
// attacks on the DNS client.
- Comm::SetSelect(fd, COMM_SELECT_READ, idnsRead, NULL, 0);
+ Comm::SetSelect(fd, COMM_SELECT_READ, idnsRead, nullptr, 0);
/* BUG (UNRESOLVED)
* two code lines after returning from comm_udprecvfrom()
break;
}
- fd_bytes(fd, len, FD_READ);
+ fd_bytes(fd, len, IoDirection::Read);
assert(N);
++(*N);
idnsCheckQueue(void *)
{
dlink_node *n;
- dlink_node *p = NULL;
+ dlink_node *p = nullptr;
idns_query *q;
event_queued = 0;
}
debugs(78, 3, "idnsCheckQueue: ID " << q->xact_id <<
- " QID 0x" << std::hex << std::setfill('0') <<
- std::setw(4) << q->query_id << ": timeout" );
+ " QID 0x" << asHex(q->query_id).minDigits(4) << ": timeout");
dlinkDelete(&q->lru, &lru_list);
q->pending = 0;
idnsSendQuery(q);
} else {
debugs(78, 2, "idnsCheckQueue: ID " << q->xact_id <<
- " QID 0x" << std::hex << q->query_id <<
- " : giving up after " << std::dec << q->nsends << " tries and " <<
+ " QID 0x" << asHex(q->query_id) <<
+ ": giving up after " << q->nsends << " tries and " <<
std::setw(5)<< std::setprecision(2) << tvSubDsec(q->start_t, current_time) << " seconds");
if (q->rcode != 0)
}
assert(vc->ns < nameservers.size());
- debugs(78, 3, HERE << conn << ": received " << vc->msg->contentSize() << " bytes via TCP from " << nameservers[vc->ns].S << ".");
+ debugs(78, 3, conn << ": received " << vc->msg->contentSize() << " bytes via TCP from " << nameservers[vc->ns].S << ".");
idnsGrokReply(vc->msg->buf, vc->msg->contentSize(), vc->ns);
vc->msg->clean();
*/
if (DnsSocketB >= 0) {
comm_local_port(DnsSocketB);
- debugs(78, DBG_IMPORTANT, "DNS Socket created at " << addrV6 << ", FD " << DnsSocketB);
- Comm::SetSelect(DnsSocketB, COMM_SELECT_READ, idnsRead, NULL, 0);
+ debugs(78, Important(16), "DNS IPv6 socket created at " << addrV6 << ", FD " << DnsSocketB);
+ Comm::SetSelect(DnsSocketB, COMM_SELECT_READ, idnsRead, nullptr, 0);
}
if (DnsSocketA >= 0) {
comm_local_port(DnsSocketA);
- debugs(78, DBG_IMPORTANT, "DNS Socket created at " << addrV4 << ", FD " << DnsSocketA);
- Comm::SetSelect(DnsSocketA, COMM_SELECT_READ, idnsRead, NULL, 0);
+ debugs(78, Important(64), "DNS IPv4 socket created at " << addrV4 << ", FD " << DnsSocketA);
+ Comm::SetSelect(DnsSocketA, COMM_SELECT_READ, idnsRead, nullptr, 0);
}
}
#endif
if (!nsFound) {
- debugs(78, DBG_IMPORTANT, "Warning: Could not find any nameservers. Trying to use localhost");
+ debugs(78, DBG_IMPORTANT, "WARNING: Could not find any nameservers. Trying to use localhost");
#if _SQUID_WINDOWS_
debugs(78, DBG_IMPORTANT, "Please check your TCP-IP settings or /etc/resolv.conf file");
#else
q->query_id = idnsQueryID();
q->sz = rfc3596BuildAAAAQuery(q->name, q->buf, sizeof(q->buf), q->query_id, &q->query, Config.dns.packet_max);
- debugs(78, 3, HERE << "buf is " << q->sz << " bytes for " << q->name <<
- ", id = 0x" << std::hex << q->query_id);
+ debugs(78, 3, "buf is " << q->sz << " bytes for " << q->name <<
+ ", id = 0x" << asHex(q->query_id));
if (!q->sz) {
delete q;
return;
}
debugs(78, 3, "idnsALookup: buf is " << q->sz << " bytes for " << q->name <<
- ", id = 0x" << std::hex << q->query_id);
+ ", id = 0x" << asHex(q->query_id));
idnsCheckMDNS(q);
idnsStartQuery(q, callback, data);
}
debugs(78, 3, "idnsPTRLookup: buf is " << q->sz << " bytes for " << ip <<
- ", id = 0x" << std::hex << q->query_id);
+ ", id = 0x" << asHex(q->query_id));
q->permit_mdns = Config.onoff.dns_mdns;
idnsStartQuery(q, callback, data);
snmp_netDnsFn(variable_list * Var, snint * ErrP)
{
int n = 0;
- variable_list *Answer = NULL;
+ variable_list *Answer = nullptr;
MemBuf tmp;
debugs(49, 5, "snmp_netDnsFn: Processing request: " << snmpDebugOid(Var->name, Var->name_length, tmp));
*ErrP = SNMP_ERR_NOERROR;