diff --git a/src/v/cluster/health_monitor_backend.cc b/src/v/cluster/health_monitor_backend.cc index 90aace877444..ac0a47dddf38 100644 --- a/src/v/cluster/health_monitor_backend.cc +++ b/src/v/cluster/health_monitor_backend.cc @@ -370,20 +370,23 @@ health_monitor_backend::collect_remote_node_health(model::node_id id) { }); } -result -map_reply_result(result reply) { +result map_reply_result( + model::node_id target_node_id, result reply) { if (!reply) { return {reply.error()}; } if (!reply.value().report.has_value()) { return {reply.value().error}; } + if (reply.value().report->id != target_node_id) { + return {errc::invalid_target_node_id}; + } return {std::move(*reply.value().report).to_in_memory()}; } result health_monitor_backend::process_node_reply( model::node_id id, result reply) { - auto res = map_reply_result(std::move(reply)); + auto res = map_reply_result(id, std::move(reply)); auto [status_it, _] = _status.try_emplace(id); if (!res) { vlog(