From: Otto Moerbeek Date: Tue, 27 Jan 2026 13:36:30 +0000 (+0100) Subject: Rename option to TRACEPARENT X-Git-Tag: rec-5.5.0-alpha0~34^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d72e2219cf36967e145dc361fe61517667b8a070;p=thirdparty%2Fpdns.git Rename option to TRACEPARENT Signed-off-by: Otto Moerbeek --- diff --git a/pdns/ednsoptions.hh b/pdns/ednsoptions.hh index b629382a67..39d7666c20 100644 --- a/pdns/ednsoptions.hh +++ b/pdns/ednsoptions.hh @@ -27,7 +27,7 @@ struct EDNSOptionCode { // Temporary code assigned for OpenTelemetry TraceID and SpanID - enum EDNSOptionCodeEnum : uint16_t {NSID=3, DAU=5, DHU=6, N3U=7, ECS=8, EXPIRE=9, COOKIE=10, TCPKEEPALIVE=11, PADDING=12, CHAIN=13, KEYTAG=14, EXTENDEDERROR=15, OTTRACEIDS=65500}; + enum EDNSOptionCodeEnum : uint16_t {NSID=3, DAU=5, DHU=6, N3U=7, ECS=8, EXPIRE=9, COOKIE=10, TCPKEEPALIVE=11, PADDING=12, CHAIN=13, KEYTAG=14, EXTENDEDERROR=15, TRACEPARENT=65500}; }; /* extract the position (relative to the optRR pointer!) and size of a specific EDNS0 option from a pointer on the beginning rdLen of the OPT RR */ diff --git a/pdns/protozero-trace.cc b/pdns/protozero-trace.cc index e28a4bef04..132f1d1e78 100644 --- a/pdns/protozero-trace.cc +++ b/pdns/protozero-trace.cc @@ -574,7 +574,7 @@ bool extractOTraceIDs(const EDNSOptionViewMap& map, EDNSOptionCode::EDNSOptionCo { EDNSOptionCode::EDNSOptionCodeEnum realEOC = eoc; if (realEOC == 0) { - realEOC = EDNSOptionCode::OTTRACEIDS; + realEOC = EDNSOptionCode::TRACEPARENT; } bool traceidset = false; if (const auto& option = map.find(realEOC); option != map.end()) { diff --git a/pdns/recursordist/pdns_recursor.cc b/pdns/recursordist/pdns_recursor.cc index bac19de847..a8b47c07a2 100644 --- a/pdns/recursordist/pdns_recursor.cc +++ b/pdns/recursordist/pdns_recursor.cc @@ -2298,7 +2298,7 @@ static string* doProcessUDPQuestion(const std::string& question, const ComboAddr ecsParsed = true; if (SyncRes::eventTraceEnabled(SyncRes::event_trace_to_ot)) { - bool ednsFound = pdns::trace::extractOTraceIDs(ednsOptions, EDNSOptionCode::OTTRACEIDS, otTrace); + bool ednsFound = pdns::trace::extractOTraceIDs(ednsOptions, EDNSOptionCode::TRACEPARENT, otTrace); if (!matchOTConditions(eventTrace, t_OTConditions, mappedSource, qname, qtype, ntohs(headerdata->id), ednsFound) && SyncRes::eventTraceEnabledOnly(SyncRes::event_trace_to_ot)) { eventTrace.setEnabled(false); } diff --git a/pdns/recursordist/rec-tcp.cc b/pdns/recursordist/rec-tcp.cc index 1b9f305572..ce5eba01fc 100644 --- a/pdns/recursordist/rec-tcp.cc +++ b/pdns/recursordist/rec-tcp.cc @@ -341,7 +341,7 @@ static void doProcessTCPQuestion(std::unique_ptr& comboWriter, s qnameParsed = true; if (SyncRes::eventTraceEnabled(SyncRes::event_trace_to_ot)) { - bool ednsFound = pdns::trace::extractOTraceIDs(ednsOptions, EDNSOptionCode::OTTRACEIDS, comboWriter->d_otTrace); + bool ednsFound = pdns::trace::extractOTraceIDs(ednsOptions, EDNSOptionCode::TRACEPARENT, comboWriter->d_otTrace); if (SyncRes::eventTraceEnabledOnly(SyncRes::event_trace_to_ot) && !matchOTConditions(comboWriter->d_eventTrace, t_OTConditions, comboWriter->d_mappedSource, qname, qtype, ntohs(comboWriter->d_mdp.d_header.id), ednsFound)) { comboWriter->d_eventTrace.setEnabled(false); } diff --git a/pdns/recursordist/recpacketcache.cc b/pdns/recursordist/recpacketcache.cc index 149a23a040..ec99fe58f5 100644 --- a/pdns/recursordist/recpacketcache.cc +++ b/pdns/recursordist/recpacketcache.cc @@ -103,7 +103,7 @@ uint64_t RecursorPacketCache::doWipePacketCache(const DNSName& name, uint16_t qt return count; } -static const std::unordered_set s_skipOptions = {EDNSOptionCode::ECS, EDNSOptionCode::COOKIE, EDNSOptionCode::OTTRACEIDS}; +static const std::unordered_set s_skipOptions = {EDNSOptionCode::ECS, EDNSOptionCode::COOKIE, EDNSOptionCode::TRACEPARENT}; bool RecursorPacketCache::qrMatch(const packetCache_t::index::type::iterator& iter, const std::string& queryPacket, const DNSName& qname, uint16_t qtype, uint16_t qclass) { diff --git a/pdns/sdig.cc b/pdns/sdig.cc index 34fd0f8cfd..d96b83099f 100644 --- a/pdns/sdig.cc +++ b/pdns/sdig.cc @@ -105,7 +105,7 @@ static void fillPacket(vector& packet, const string& q, const string& t record.setTraceID(traceid); record.setSpanID(spanid); record.setFlags(flags); - opts.emplace_back(EDNSOptionCode::OTTRACEIDS, std::string_view(reinterpret_cast(data.data()), data.size())); // NOLINT + opts.emplace_back(EDNSOptionCode::TRACEPARENT, std::string_view(reinterpret_cast(data.data()), data.size())); // NOLINT } pw.addOpt(bufsize, 0, dnssec ? EDNSOpts::DNSSECOK : 0, opts); pw.commit();