From c85f69a8de9d3b8bd63a1a0648790d8a8d6b5fc3 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Tue, 23 Jan 2018 10:21:26 +0100 Subject: [PATCH] XPF, dnsdist: Rename Option Code to RR Code And add some docs. --- pdns/dnsdist-lua.cc | 2 +- pdns/dnsdist-tcp.cc | 4 ++-- pdns/dnsdist.cc | 4 ++-- pdns/dnsdist.hh | 2 +- pdns/dnsdistdist/docs/reference/config.rst | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pdns/dnsdist-lua.cc b/pdns/dnsdist-lua.cc index 0be2c3e84..d8a8c916f 100644 --- a/pdns/dnsdist-lua.cc +++ b/pdns/dnsdist-lua.cc @@ -310,7 +310,7 @@ void setupLuaConfig(bool client) } if(vars.count("addXPF")) { - ret->xpfOptionCode=std::stoi(boost::get(vars["addXPF"])); + ret->xpfRRCode=std::stoi(boost::get(vars["addXPF"])); } if(vars.count("maxCheckFailures")) { diff --git a/pdns/dnsdist-tcp.cc b/pdns/dnsdist-tcp.cc index 13be397e9..12634107c 100644 --- a/pdns/dnsdist-tcp.cc +++ b/pdns/dnsdist-tcp.cc @@ -440,8 +440,8 @@ void* tcpClientThread(int pipefd) break; } - if (dq.addXPF && ds->xpfOptionCode != 0) { - addXPF(dq, ds->xpfOptionCode); + if (dq.addXPF && ds->xpfRRCode != 0) { + addXPF(dq, ds->xpfRRCode); } int dsock = -1; diff --git a/pdns/dnsdist.cc b/pdns/dnsdist.cc index 74924d3ec..3cd4d2c4c 100644 --- a/pdns/dnsdist.cc +++ b/pdns/dnsdist.cc @@ -1389,8 +1389,8 @@ static void processUDPQuery(ClientState& cs, LocalHolders& holders, const struct return; } - if (dq.addXPF && ss->xpfOptionCode != 0) { - addXPF(dq, ss->xpfOptionCode); + if (dq.addXPF && ss->xpfRRCode != 0) { + addXPF(dq, ss->xpfRRCode); } ss->queries++; diff --git a/pdns/dnsdist.hh b/pdns/dnsdist.hh index 6352f205f..19e2db2dd 100644 --- a/pdns/dnsdist.hh +++ b/pdns/dnsdist.hh @@ -624,7 +624,7 @@ struct DownstreamState int tcpSendTimeout{30}; unsigned int sourceItf{0}; uint16_t retries{5}; - uint16_t xpfOptionCode{0}; + uint16_t xpfRRCode{0}; uint8_t currentCheckFailures{0}; uint8_t maxCheckFailures{1}; StopWatch sw; diff --git a/pdns/dnsdistdist/docs/reference/config.rst b/pdns/dnsdistdist/docs/reference/config.rst index 401437563..bf2dbe779 100644 --- a/pdns/dnsdistdist/docs/reference/config.rst +++ b/pdns/dnsdistdist/docs/reference/config.rst @@ -269,7 +269,7 @@ Servers -- "interface name", e.g. "eth0" -- "address@interface", e.g. "192.0.2.2@eth0" addXPF=NUM -- Add the client's IP address and port to the query, along with the original destination address and port, - -- using the experimental XPF record from `draft-bellis-dnsop-xpf` and the specified option code. Default is disabled (0) + -- using the experimental XPF record from `draft-bellis-dnsop-xpf `_ and the specified option code. Default is disabled (0) }) :param str server_string: A simple IP:PORT string. -- 2.40.0