|
|
|
|
@ -434,16 +434,16 @@ static void cs_join_timeout_cb(void* arg) {
|
|
|
|
|
/* ── helper: find active ETCP_CONN for node ── */ |
|
|
|
|
|
|
|
|
|
static struct ETCP_CONN* cs_find_conn_for_node(struct UTUN_INSTANCE* inst, uint64_t node_id) { |
|
|
|
|
if (!inst->connections) { DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG, "%s: find_conn connections=NULL", CS_ID); return NULL; } |
|
|
|
|
if (!inst->connections) { DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "%s: find_conn connections=NULL", CS_ID); return NULL; } |
|
|
|
|
struct ll_entry* e = queue_find_data_by_index(inst->connections, (const uint8_t*)&node_id); |
|
|
|
|
if (e) { |
|
|
|
|
struct conn_queue_entry* ce = (struct conn_queue_entry*)e->data; |
|
|
|
|
DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG, "%s: find_conn node=%016llx found=%p initialized=%d links_up=%d state=%d", |
|
|
|
|
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "%s: find_conn node=%016llx found=%p initialized=%d links_up=%d state=%d", |
|
|
|
|
CS_ID, (unsigned long long)node_id, (void*)ce->conn, ce->conn->initialized, ce->conn->links_up, ce->conn->state); |
|
|
|
|
if (ce->conn->initialized && ce->conn->links_up) return ce->conn; |
|
|
|
|
return NULL; |
|
|
|
|
} |
|
|
|
|
DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG, "%s: find_conn node=%016llx NOT FOUND in queue (head=%p count=%d)", |
|
|
|
|
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "%s: find_conn node=%016llx NOT FOUND in queue (head=%p count=%d)", |
|
|
|
|
CS_ID, (unsigned long long)node_id, (void*)inst->connections->head, queue_entry_count(inst->connections)); |
|
|
|
|
return NULL; |
|
|
|
|
} |
|
|
|
|
@ -492,7 +492,7 @@ static void cs_on_conn_up(struct ETCP_CONN* conn, void* arg) {
|
|
|
|
|
if (!conn || !g_cs) return; |
|
|
|
|
uint64_t peer = conn->peer_node_id; |
|
|
|
|
if (peer == 0 || peer == g_cs->inst->node_id) return; |
|
|
|
|
if (!conn->initialized) { DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG, "%s: conn_up SKIP — not initialized peer=%016llx", CS_ID, (unsigned long long)peer); return; } |
|
|
|
|
if (!conn->initialized) { DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "%s: conn_up SKIP — not initialized peer=%016llx", CS_ID, (unsigned long long)peer); return; } |
|
|
|
|
|
|
|
|
|
if (g_cs->pending_invite_ch_id != 0 && !g_cs->info_req_timer) { |
|
|
|
|
DEBUG_INFO(DEBUG_CATEGORY_CONNECTIVITY, "%s: conn_up invite path peer=%016llx ch=%llu", |
|
|
|
|
|