invite: диагностика адресов в цепочке invite→etcp_connect

This commit is contained in:
Evgeny committed 2026-08-13 21:11:27 +03:00
1 parent d166c18155
commit 37ef08a015
5 files changed
+70 -19

No files matched your search

+12
View File
@@ -119,6 +119,14 @@ struct TOPO_NODE* topo_node_registry_store(struct TOPO_GROUPS* groups, struct TO
if (!groups || !ni) return NULL;
struct TOPO_NODE* existing = topo_node_registry_find(groups, ni->node_id);
if (existing) {
int n4 = topo_list_count((struct _topo_head*)ni->v4_addrs);
int n6 = topo_list_count((struct _topo_head*)ni->v6_addrs);
int e4 = topo_list_count((struct _topo_head*)existing->v4_addrs);
int e6 = topo_list_count((struct _topo_head*)existing->v6_addrs);
int drop4 = (e4 && n4), drop6 = (e6 && n6);
if (drop4 || drop6)
DEBUG_WARN(DEBUG_CATEGORY_BGP, "registry_store: node=%016llx EXISTS — dropping new addrs v4=%d v6=%d (existing v4=%d v6=%d)",
(unsigned long long)ni->node_id, drop4 ? n4 : 0, drop6 ? n6 : 0, e4, e6);
topo_node_ref(existing);
if (!existing->v4_addrs && ni->v4_addrs) { existing->v4_addrs = ni->v4_addrs; ni->v4_addrs = NULL; }
if (!existing->v6_addrs && ni->v6_addrs) { existing->v6_addrs = ni->v6_addrs; ni->v6_addrs = NULL; }
@@ -134,6 +142,10 @@ struct TOPO_NODE* topo_node_registry_store(struct TOPO_GROUPS* groups, struct TO
memcpy(qe->data, &ni->node_id, 8);
memcpy(qe->data + 8, &ni, sizeof(ni));
queue_data_put_with_index(groups->node_registry, qe);
DEBUG_DEBUG(DEBUG_CATEGORY_BGP, "registry_store: node=%016llx NEW v4=%d v6=%d",
(unsigned long long)ni->node_id,
topo_list_count((struct _topo_head*)ni->v4_addrs),
topo_list_count((struct _topo_head*)ni->v6_addrs));
return ni;
}