dns_utils: really add default DNSSEC servers on failure

Coverity 196597
This commit is contained in:
moneromooo-monero 2019-03-20 23:43:51 +00:00
parent f2f725d8db
commit 223c6b0796
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3

View File

@ -293,9 +293,8 @@ DNSResolver::DNSResolver() : m_data(new DNSResolverData())
ub_ctx_delete(m_data->m_ub_context); ub_ctx_delete(m_data->m_ub_context);
m_data->m_ub_context = ub_ctx_create(); m_data->m_ub_context = ub_ctx_create();
add_anchors(m_data->m_ub_context); add_anchors(m_data->m_ub_context);
dns_public_addr = tools::dns_utils::parse_dns_public(DNS_PUBLIC); for (const auto &ip: DEFAULT_DNS_PUBLIC_ADDR)
for (const auto &ip: dns_public_addr) ub_ctx_set_fwd(m_data->m_ub_context, string_copy(ip));
ub_ctx_set_fwd(m_data->m_ub_context, string_copy(ip.c_str()));
ub_ctx_set_option(m_data->m_ub_context, string_copy("do-udp:"), string_copy("no")); ub_ctx_set_option(m_data->m_ub_context, string_copy("do-udp:"), string_copy("no"));
ub_ctx_set_option(m_data->m_ub_context, string_copy("do-tcp:"), string_copy("yes")); ub_ctx_set_option(m_data->m_ub_context, string_copy("do-tcp:"), string_copy("yes"));
} }