From 0348b22b1e6d2bf6b87f5cff55934a9e28b2e68d Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Sat, 23 May 2015 21:44:29 +0300 Subject: [PATCH] distributed allocation server - StateReport fix --- .../dynamic_node_id_server/distributed/server.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libuavcan/include/uavcan/protocol/dynamic_node_id_server/distributed/server.hpp b/libuavcan/include/uavcan/protocol/dynamic_node_id_server/distributed/server.hpp index 940529e358..22b3a4b9be 100644 --- a/libuavcan/include/uavcan/protocol/dynamic_node_id_server/distributed/server.hpp +++ b/libuavcan/include/uavcan/protocol/dynamic_node_id_server/distributed/server.hpp @@ -356,6 +356,18 @@ struct StateReport { last_log_term = e->term; } + + for (uint8_t i = 0; i < (cluster_size - 1U); i++) + { + const ClusterManager& mgr = s.getRaftCore().getClusterManager(); + const NodeID node_id = mgr.getRemoteServerNodeIDAtIndex(i); + if (node_id.isUnicast()) + { + followers[i].node_id = node_id; + followers[i].next_index = mgr.getServerNextIndex(node_id); + followers[i].match_index = mgr.getServerMatchIndex(node_id); + } + } } };