#ifdef HAVE_PROTOBUF
-static void logOutgoingQuery(std::shared_ptr<RemoteLogger> outgoingLogger, boost::optional<const boost::uuids::uuid&> initialRequestId, const boost::uuids::uuid& uuid, const ComboAddress& ip, const DNSName& domain, int type, uint16_t qid, bool doTCP, size_t bytes)
+static void logOutgoingQuery(std::shared_ptr<RemoteLogger> outgoingLogger, boost::optional<const boost::uuids::uuid&> initialRequestId, const boost::uuids::uuid& uuid, const ComboAddress& ip, const DNSName& domain, int type, uint16_t qid, bool doTCP, size_t bytes, boost::optional<Netmask>& srcmask)
{
if(!outgoingLogger)
return;
message.setInitialRequestID(*initialRequestId);
}
+ if (srcmask) {
+ message.setEDNSSubnet(*srcmask);
+ }
+
// cerr <<message.toDebugString()<<endl;
std::string str;
message.serialize(str);
pw.addOpt(g_outgoingEDNSBufsize, 0, g_dnssecmode == DNSSECMode::Off ? 0 : EDNSOpts::DNSSECOK, opts);
pw.commit();
}
- srcmask = boost::none; // this is also our return value, even if EDNS0Level == 0
lwr->d_rcode = 0;
lwr->d_haveEDNS = false;
int ret;
if (outgoingLogger) {
uuid = (*t_uuidGenerator)();
- logOutgoingQuery(outgoingLogger, context ? context->d_initialRequestId : boost::none, uuid, ip, domain, type, qid, doTCP, vpacket.size());
+ logOutgoingQuery(outgoingLogger, context ? context->d_initialRequestId : boost::none, uuid, ip, domain, type, qid, doTCP, vpacket.size(), srcmask);
}
#endif
+ srcmask = boost::none; // this is also our return value, even if EDNS0Level == 0
+
errno=0;
if(!doTCP) {
int queryfd;