From: Remi Gacogne Date: Mon, 9 Oct 2023 09:10:17 +0000 (+0200) Subject: dnsdist: Apply Otto's suggestions to the EDE code and docs X-Git-Tag: rec-5.0.0-alpha2~22^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6d21517a9013baf0cf762ecd0590d8cf4452cbc4;p=thirdparty%2Fpdns.git dnsdist: Apply Otto's suggestions to the EDE code and docs --- diff --git a/pdns/dnsdistdist/dnsdist-edns.cc b/pdns/dnsdistdist/dnsdist-edns.cc index a5aba4aae9..1131bf29bc 100644 --- a/pdns/dnsdistdist/dnsdist-edns.cc +++ b/pdns/dnsdistdist/dnsdist-edns.cc @@ -34,7 +34,7 @@ std::pair, std::optional> getExtendedDNSErr int res = locateEDNSOptRR(packet, &optStart, &optLen, &last); if (res != 0) { - return std::make_pair(std::nullopt, std::nullopt); + return {std::nullopt, std::nullopt}; } size_t optContentStart = 0; @@ -43,7 +43,7 @@ std::pair, std::optional> getExtendedDNSErr std::optional extraText{std::nullopt}; /* we need at least 2 bytes after the option length (info-code) */ if (!isEDNSOptionInOpt(packet, optStart, optLen, EDNSOptionCode::EXTENDEDERROR, &optContentStart, &optContentLen) || optContentLen < sizeof(infoCode)) { - return std::make_pair(std::nullopt, std::nullopt); + return {std::nullopt, std::nullopt}; } memcpy(&infoCode, &packet.at(optContentStart), sizeof(infoCode)); infoCode = ntohs(infoCode); @@ -53,6 +53,6 @@ std::pair, std::optional> getExtendedDNSErr extraText->resize(optContentLen - sizeof(infoCode)); memcpy(extraText->data(), &packet.at(optContentStart + sizeof(infoCode)), optContentLen - sizeof(infoCode)); } - return std::make_pair(infoCode, std::move(extraText)); + return {infoCode, std::move(extraText)}; } } diff --git a/pdns/dnsdistdist/docs/rules-actions.rst b/pdns/dnsdistdist/docs/rules-actions.rst index 19c4ed51b4..db85036754 100644 --- a/pdns/dnsdistdist/docs/rules-actions.rst +++ b/pdns/dnsdistdist/docs/rules-actions.rst @@ -1441,7 +1441,7 @@ The following actions exist. * ``serverID=""``: str - Set the Server Identity field. * ``ipEncryptKey=""``: str - A key, that can be generated via the :func:`makeIPCipherKey` function, to encrypt the IP address of the requestor for anonymization purposes. The encryption is done using ipcrypt for IPv4 and a 128-bit AES ECB operation for IPv6. * ``exportTags=""``: str - The comma-separated list of keys of internal tags to export into the ``tags`` Protocol Buffer field, as "key:value" strings. Note that a tag with an empty value will be exported as "", not ":". An empty string means that no internal tag will be exported. The special value ``*`` means that all tags will be exported. - * ``exportExtendedErrorsToMeta=""``: str - Export Extended DNS Errors present in the DNS response, if any, into the specified ``tags`` Protocol Buffer field. The EDE info code will be exported as an integer value, and the EDE extra text, if present, as a string value. + * ``exportExtendedErrorsToMeta=""``: str - Export Extended DNS Errors present in the DNS response, if any, into the ``meta`` Protocol Buffer field using the specified ``key``. The EDE info code will be exported as an integer value, and the EDE extra text, if present, as a string value. .. function:: SetAdditionalProxyProtocolValueAction(type, value)