]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Apply Otto's suggestions to the EDE code and docs 13185/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 9 Oct 2023 09:10:17 +0000 (11:10 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 9 Oct 2023 09:10:17 +0000 (11:10 +0200)
pdns/dnsdistdist/dnsdist-edns.cc
pdns/dnsdistdist/docs/rules-actions.rst

index a5aba4aae96b44d77824334f4b8ad6ea4b134ed0..1131bf29bc66150c0effe25d86d2a8db1b0b3260 100644 (file)
@@ -34,7 +34,7 @@ std::pair<std::optional<uint16_t>, std::optional<std::string>> 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<uint16_t>, std::optional<std::string>> getExtendedDNSErr
   std::optional<std::string> 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<uint16_t>, std::optional<std::string>> 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)};
 }
 }
index 19c4ed51b4ae3166950c2c542af12c56c126ec68..db85036754e4d621970511a75b2145754fd5f4b0 100644 (file)
@@ -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 "<key>", not "<key>:". 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)