if(d_logDNSDetails)
g_log<<Logger::Error<<"Received an answer (non-query) packet from "<<p.getRemoteString()<<", dropping"<<endl;
S.inc("corrupt-packets");
- S.ringAccount("remotes-corrupt", p.d_remote);
+ S.ringAccount("remotes-corrupt", p.getInnerRemote());
return nullptr;
}
if(d_logDNSDetails)
g_log<<Logger::Error<<"Received truncated query packet from "<<p.getRemoteString()<<", dropping"<<endl;
S.inc("corrupt-packets");
- S.ringAccount("remotes-corrupt", p.d_remote);
+ S.ringAccount("remotes-corrupt", p.getInnerRemote());
return nullptr;
}
if(d_logDNSDetails)
g_log<<Logger::Error<<"Received a malformed qdomain from "<<p.getRemoteString()<<", '"<<p.qdomain<<"': sending servfail"<<endl;
S.inc("corrupt-packets");
- S.ringAccount("remotes-corrupt", p.d_remote);
+ S.ringAccount("remotes-corrupt", p.getInnerRemote());
S.inc("servfail-packets");
r->setRcode(RCode::ServFail);
return r;
static AtomicCounter &tcpbytesanswered4=*S.getPointer("tcp4-answers-bytes");
static AtomicCounter &tcpbytesanswered6=*S.getPointer("tcp6-answers-bytes");
+ ComboAddress& accountremote = p.d_remote;
+ if (p.d_inner_remote) accountremote = *p.d_inner_remote;
+
if(p.d.aa) {
if (p.d.rcode==RCode::NXDomain) {
S.inc("nxdomain-packets");
} else if (p.d.rcode == RCode::Refused) {
S.inc("unauth-packets");
S.ringAccount("unauth-queries", p.qdomain, p.qtype);
- S.ringAccount("remotes-unauth",p.d_remote);
+ S.ringAccount("remotes-unauth", accountremote);
}
if (udpOrTCP) { // udp
udpnumanswered++;
udpbytesanswered+=buf.length();
- if(p.d_remote.sin4.sin_family==AF_INET) {
+ if(accountremote.sin4.sin_family==AF_INET) {
udpnumanswered4++;
udpbytesanswered4+=buf.length();
} else {
}
} else { //tcp
tcpbytesanswered+=buf.length();
- if(p.d_remote.sin4.sin_family==AF_INET) {
+ if(accountremote.sin4.sin_family==AF_INET) {
tcpbytesanswered4+=buf.length();
} else {
tcpbytesanswered6+=buf.length();
}
if(last) {
tcpnumanswered++;
- if(p.d_remote.sin4.sin_family==AF_INET) {
+ if(accountremote.sin4.sin_family==AF_INET) {
tcpnumanswered4++;
} else {
tcpnumanswered6++;