From: Remi Gacogne Date: Thu, 5 Feb 2026 15:54:38 +0000 (+0100) Subject: dnsdist: Export DNS flags via ProtoBuf X-Git-Tag: rec-5.5.0-alpha0~10^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f74d852349c03db5680fe7f153d6cb5899c05fa;p=thirdparty%2Fpdns.git dnsdist: Export DNS flags via ProtoBuf Signed-off-by: Remi Gacogne --- diff --git a/pdns/dnsdistdist/dnsdist-protobuf.cc b/pdns/dnsdistdist/dnsdist-protobuf.cc index 6559cfa454..71d1f9d578 100644 --- a/pdns/dnsdistdist/dnsdist-protobuf.cc +++ b/pdns/dnsdistdist/dnsdist-protobuf.cc @@ -172,6 +172,14 @@ void DNSDistProtoBufMessage::serialize(std::string& data, bool withOpenTelemetry msg.setRequest(d_dq.ids.d_protoBufData && d_dq.ids.d_protoBufData->uniqueId ? *d_dq.ids.d_protoBufData->uniqueId : getUniqueID(), d_requestor ? *d_requestor : d_dq.ids.origRemote, d_responder ? *d_responder : d_dq.ids.origDest, d_question ? d_question->d_name : d_dq.ids.qname, d_question ? d_question->d_type : d_dq.ids.qtype, d_question ? d_question->d_class : d_dq.ids.qclass, d_dq.getHeader()->id, protocol, d_bytes ? *d_bytes : d_dq.getData().size()); + try { + msg.setHeaderFlags(*getFlagsFromDNSHeader(d_dq.getHeader().get())); + } + catch (const std::exception& exp) { + VERBOSESLOG(infolog("Error while getting the flags from the DNS header of a packet to add them to the protobuf message: %s", exp.what()), + dnsdist::logging::getTopLogger("protobuf")->error(Logr::Info, exp.what(), "Error while getting the flags from the DNS header of a packet to add them to the protobuf message")); + } + if (d_serverIdentity) { msg.setServerIdentity(*d_serverIdentity); }