diff options
Diffstat (limited to 'src/resolve/resolved-manager.c')
-rw-r--r-- | src/resolve/resolved-manager.c | 53 |
1 files changed, 25 insertions, 28 deletions
diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c index 2eee418adf..9bbdc648fc 100644 --- a/src/resolve/resolved-manager.c +++ b/src/resolve/resolved-manager.c @@ -1165,7 +1165,6 @@ static int dns_question_to_json(DnsQuestion *q, sd_json_variant **ret) { int manager_monitor_send(Manager *m, DnsQuery *q) { _cleanup_(sd_json_variant_unrefp) sd_json_variant *jquestion = NULL, *jcollected_questions = NULL, *janswer = NULL; _cleanup_(dns_question_unrefp) DnsQuestion *merged = NULL; - Varlink *connection; DnsAnswerItem *rri; int r; @@ -1220,34 +1219,32 @@ int manager_monitor_send(Manager *m, DnsQuery *q) { return log_debug_errno(r, "Failed to append notification entry to array: %m"); } - SET_FOREACH(connection, m->varlink_subscription) { - r = varlink_notifybo( - connection, - SD_JSON_BUILD_PAIR("state", SD_JSON_BUILD_STRING(dns_transaction_state_to_string(q->state))), - SD_JSON_BUILD_PAIR_CONDITION(q->state == DNS_TRANSACTION_DNSSEC_FAILED, - "result", SD_JSON_BUILD_STRING(dnssec_result_to_string(q->answer_dnssec_result))), - SD_JSON_BUILD_PAIR_CONDITION(q->state == DNS_TRANSACTION_RCODE_FAILURE, - "rcode", SD_JSON_BUILD_INTEGER(q->answer_rcode)), - SD_JSON_BUILD_PAIR_CONDITION(q->state == DNS_TRANSACTION_ERRNO, - "errno", SD_JSON_BUILD_INTEGER(q->answer_errno)), - SD_JSON_BUILD_PAIR_CONDITION(IN_SET(q->state, - DNS_TRANSACTION_DNSSEC_FAILED, - DNS_TRANSACTION_RCODE_FAILURE) && - q->answer_ede_rcode >= 0, - "extendedDNSErrorCode", SD_JSON_BUILD_INTEGER(q->answer_ede_rcode)), - SD_JSON_BUILD_PAIR_CONDITION(IN_SET(q->state, - DNS_TRANSACTION_DNSSEC_FAILED, - DNS_TRANSACTION_RCODE_FAILURE) && - q->answer_ede_rcode >= 0 && !isempty(q->answer_ede_msg), - "extendedDNSErrorMessage", SD_JSON_BUILD_STRING(q->answer_ede_msg)), - SD_JSON_BUILD_PAIR("question", SD_JSON_BUILD_VARIANT(jquestion)), - SD_JSON_BUILD_PAIR_CONDITION(!!jcollected_questions, - "collectedQuestions", SD_JSON_BUILD_VARIANT(jcollected_questions)), - SD_JSON_BUILD_PAIR_CONDITION(!!janswer, + r = varlink_many_notifybo( + m->varlink_subscription, + SD_JSON_BUILD_PAIR("state", SD_JSON_BUILD_STRING(dns_transaction_state_to_string(q->state))), + SD_JSON_BUILD_PAIR_CONDITION(q->state == DNS_TRANSACTION_DNSSEC_FAILED, + "result", SD_JSON_BUILD_STRING(dnssec_result_to_string(q->answer_dnssec_result))), + SD_JSON_BUILD_PAIR_CONDITION(q->state == DNS_TRANSACTION_RCODE_FAILURE, + "rcode", SD_JSON_BUILD_INTEGER(q->answer_rcode)), + SD_JSON_BUILD_PAIR_CONDITION(q->state == DNS_TRANSACTION_ERRNO, + "errno", SD_JSON_BUILD_INTEGER(q->answer_errno)), + SD_JSON_BUILD_PAIR_CONDITION(IN_SET(q->state, + DNS_TRANSACTION_DNSSEC_FAILED, + DNS_TRANSACTION_RCODE_FAILURE) && + q->answer_ede_rcode >= 0, + "extendedDNSErrorCode", SD_JSON_BUILD_INTEGER(q->answer_ede_rcode)), + SD_JSON_BUILD_PAIR_CONDITION(IN_SET(q->state, + DNS_TRANSACTION_DNSSEC_FAILED, + DNS_TRANSACTION_RCODE_FAILURE) && + q->answer_ede_rcode >= 0 && !isempty(q->answer_ede_msg), + "extendedDNSErrorMessage", SD_JSON_BUILD_STRING(q->answer_ede_msg)), + SD_JSON_BUILD_PAIR("question", SD_JSON_BUILD_VARIANT(jquestion)), + SD_JSON_BUILD_PAIR_CONDITION(!!jcollected_questions, + "collectedQuestions", SD_JSON_BUILD_VARIANT(jcollected_questions)), + SD_JSON_BUILD_PAIR_CONDITION(!!janswer, "answer", SD_JSON_BUILD_VARIANT(janswer))); - if (r < 0) - log_debug_errno(r, "Failed to send monitor event, ignoring: %m"); - } + if (r < 0) + log_debug_errno(r, "Failed to send monitor event, ignoring: %m"); return 0; } |