route_connectivity: фикс UAF при удалении узла с влётными пробами; отмена TCP-пингов при teardown
- topo_nodeq_remove_node: единый хелпер удаления nq (cancel проб + free paths/subnets + remove + free), заменяет все free-сайты - route_connectivity_cancel_all: итерация по всем группам + зануление ctx->nq + отмена standby-defer - etcp_send_tcp_ping: out_cli — хендл stcp_client для досрочной отмены; conn_probe_ctx.tcp_cli - conn_mgr: cand_tcp_pings[] — отмена влётных candidate TCP-пингов в conn_mgr_destroy
This commit is contained in:
1 parent
3f7b4351cd
commit
08e8b2f1cc
12 files changed
+91
-55
No files matched your search
@@ -11,6 +11,7 @@
|
||||
#include "config_parser.h"
|
||||
#include "topo_node.h"
|
||||
#include "topo_group.h"
|
||||
#include "route_connectivity.h"
|
||||
#include "route_lib.h"
|
||||
#include "etcp_debug.h"
|
||||
#include "topo_node_sqlite.h"
|
||||
@@ -186,6 +187,17 @@ void topo_nodeq_free_group_fields(struct TOPO_GROUPS* groups, struct TOPO_GROUP_
|
||||
nq->handle = NULL;
|
||||
}
|
||||
|
||||
/* Полное удаление узла из группы: отмена влётных проб, освобождение paths/subnets,
|
||||
* извлечение из group->nodes и освобождение самого nq. Единственный корректный способ удаления. */
|
||||
void topo_nodeq_remove_node(struct TOPO_GROUP* group, struct TOPO_GROUP_NODE* nq) {
|
||||
if (!group || !nq) return;
|
||||
route_connectivity_cancel_node(nq);
|
||||
if (nq->paths) { queue_free(nq->paths); nq->paths = NULL; }
|
||||
queue_remove_data(group->nodes, &nq->ll);
|
||||
topo_nodeq_free_group_fields(group->instance ? group->instance->topo_groups : NULL, nq);
|
||||
queue_entry_free(&nq->ll);
|
||||
}
|
||||
|
||||
// ===== глобальный реестр TOPO_NODE =====
|
||||
|
||||
/* Ищет TOPO_NODE в глобальном реестре по node_id (NULL, если узла нет). */
|
||||
|
||||
Reference in new issue
Block a user