From 8d72bcdd2ca354afc2b645a34753e91ca775f9ae Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Wed, 22 Aug 2018 15:50:48 +0200 Subject: [PATCH] dnsdist: Clarify doc/completion of setPayloadSizeOnSelfGeneratedAnswers --- pdns/dnsdist-console.cc | 2 +- pdns/dnsdist-lua-actions.cc | 2 +- pdns/dnsdistdist/docs/reference/config.rst | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pdns/dnsdist-console.cc b/pdns/dnsdist-console.cc index 2bbfb04374..4eda5b0553 100644 --- a/pdns/dnsdist-console.cc +++ b/pdns/dnsdist-console.cc @@ -424,7 +424,7 @@ const std::vector g_consoleKeywords{ { "setMaxTCPQueriesPerConnection", true, "n", "set the maximum number of queries in an incoming TCP connection. 0 means unlimited" }, { "setMaxTCPQueuedConnections", true, "n", "set the maximum number of TCP connections queued (waiting to be picked up by a client thread)" }, { "setMaxUDPOutstanding", true, "n", "set the maximum number of outstanding UDP queries to a given backend server. This can only be set at configuration time and defaults to 10240" }, - { "setPayloadSizeOnSelfGeneratedAnswers", true, "add", "set the UDP payload size advertised via EDNS on self-generated responses" }, + { "setPayloadSizeOnSelfGeneratedAnswers", true, "payloadSize", "set the UDP payload size advertised via EDNS on self-generated responses" }, { "setPoolServerPolicy", true, "policy, pool", "set the server selection policy for this pool to that policy" }, { "setPoolServerPolicy", true, "name, func, pool", "set the server selection policy for this pool to one named 'name' and provided by 'function'" }, { "setQueryCount", true, "bool", "set whether queries should be counted" }, diff --git a/pdns/dnsdist-lua-actions.cc b/pdns/dnsdist-lua-actions.cc index a9f64a40f3..377add214c 100644 --- a/pdns/dnsdist-lua-actions.cc +++ b/pdns/dnsdist-lua-actions.cc @@ -457,7 +457,7 @@ DNSAction::Action SpoofAction::operator()(DNSQuestion* dq, string* ruleresult) c dq->dh->ancount = htons(dq->dh->ancount); - if (hadEDNS && g_addEDNSToSelfGeneratedResponses) { + if (hadEDNS) { addEDNS(dq->dh, dq->len, dq->size, dnssecOK, g_PayloadSizeSelfGenAnswers); } diff --git a/pdns/dnsdistdist/docs/reference/config.rst b/pdns/dnsdistdist/docs/reference/config.rst index ab9b3a3d93..f2c055b92a 100644 --- a/pdns/dnsdistdist/docs/reference/config.rst +++ b/pdns/dnsdistdist/docs/reference/config.rst @@ -969,10 +969,11 @@ overriden using :func:`setPayloadSizeOnSelfGeneratedAnswers`. :param bool add: Whether to add EDNS, default is true. -.. function:: setPayloadSizeOnSelfGeneratedAnswers(size) +.. function:: setPayloadSizeOnSelfGeneratedAnswers(payloadSize) .. versionadded:: 1.3.3 - Set the UDP payload size advertised via EDNS on self-generated responses. + Set the UDP payload size advertised via EDNS on self-generated responses. In accordance with + :rfc:`RFC 6891 <6891#section-6.2.5>`, values lower than 512 will be treated as equal to 512. - :param int size: The responder's maximum UDP payload size, in bytes. Default is 1500. + :param int payloadSize: The responder's maximum UDP payload size, in bytes. Default is 1500. -- 2.47.2