state->d_tcpConcurrentConnectionsLimit = bind.tcp.max_concurrent_connections;
}
- for (const auto& addr : bind.additional_addresses) {
- try {
- ComboAddress address{std::string(addr)};
- state->d_additionalAddresses.emplace_back(address, -1);
- }
- catch (const PDNSException& e) {
- errlog("Unable to parse additional address %s for %s bind: %s", std::string(addr), protocol, e.reason);
+ if (protocol == "dot" || protocol == "doh") {
+ for (const auto& addr : bind.additional_addresses) {
+ try {
+ ComboAddress address{std::string(addr)};
+ state->d_additionalAddresses.emplace_back(address, -1);
+ }
+ catch (const PDNSException& e) {
+ errlog("Unable to parse additional address %s for %s bind: %s", std::string(addr), protocol, e.reason);
+ }
}
}
+ else if (!bind.additional_addresses.empty()) {
+ throw std::runtime_error("Passing a non-empty additional_addresses value to a " + protocol + " frontend is not supported");
+ }
if (protocol == "dnscrypt") {
#if defined(HAVE_DNSCRYPT)
- name: "additional_addresses"
type: "Vec<String>"
default: ""
- description: "List of additional addresses (with port) to listen on. Using this option instead of creating a new frontend for each address avoids the creation of new thread and Frontend objects, reducing the memory usage. The drawback is that there will be a single set of metrics for all addresses"
+ description: "List of additional addresses (with port) to listen on. Using this option instead of creating a new frontend for each address avoids the creation of new thread and Frontend objects, reducing the memory usage. The drawback is that there will be a single set of metrics for all addresses. This is only supported for DoT and DoH frontends, and therefore passing a non-empty list for other protocols will trigger an error"
- name: "xsk"
type: "String"
default: ""