res_resolver_unbound: Include libunbound error reason

Failures returned by ub_resolve_async() are currently logged without the
reason provided by libunbound, making resolver configuration failures
difficult to diagnose.

Include ub_strerror() in the error message so the underlying libunbound
failure reason is available in the Asterisk log.

Resolves: #2110
pull/2323/head
Mehrdad Seifzadeh 3 months ago
parent 8eb935aee9
commit 29b8abfb9b

@ -329,8 +329,8 @@ static int unbound_resolver_resolve(struct ast_dns_query *query)
ao2_bump(query), unbound_resolver_callback, &data->id);
if (res) {
ast_log(LOG_ERROR, "Failed to perform async DNS resolution of '%s'\n",
ast_dns_query_get_name(query));
ast_log(LOG_ERROR, "Failed to perform async DNS resolution of '%s': %s\n",
ast_dns_query_get_name(query), ub_strerror(res));
ao2_ref(query, -1);
}

Loading…
Cancel
Save