etcp: защита от UAF в start_keepalive_timer/enter_ready_tcp + диагностика указателей
- start_keepalive_timer: guard !link->etcp->instance->ua (SIGSEGV на 80 строке) - etcp_link_enter_ready_tcp: return при etcp->state==2 после reinit/apply_reset/conn_ready - tcp_server_on_link/enter_ready_tcp: DEBUG_CATEGORY_DEBUG с адресами link/etcp/inst/ua - topo_node: убрать лишние DEBUG_CATEGORY_DEBUG (chain_rtt)
This commit is contained in:
1 parent
7de636be6e
commit
be1f08b43e
3 files changed
+14
-7
No files matched your search
@@ -564,24 +564,17 @@ void topo_node_ping_update_rtt(struct TOPO_GROUPS* groups, uint64_t node_id, uin
|
||||
|
||||
uint16_t topo_get_chain_rtt(struct TOPO_GROUP_NODE* nq) {
|
||||
if (!nq || !nq->paths || !nq->paths->head) {
|
||||
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "chain_rtt: nid=%016llx NO PATHS", (unsigned long long)(nq ? nq->node_id : 0));
|
||||
return 0xFFFF;
|
||||
}
|
||||
uint16_t best = 0xFFFF;
|
||||
for (struct ll_entry* e = nq->paths->head; e; e = e->next) {
|
||||
struct TOPO_NODEPATH* p = (struct TOPO_NODEPATH*)e;
|
||||
if (!p->conn || !p->conn->links_up || !p->conn->rtt_last) {
|
||||
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "chain_rtt: nid=%016llx SKIP conn=%s up=%d rtt=%u cum=%u",
|
||||
(unsigned long long)nq->node_id, p->conn ? p->conn->log_name : "NULL",
|
||||
p->conn ? p->conn->links_up : 0, p->conn ? p->conn->rtt_last : 0, p->cumulative_rtt);
|
||||
continue;
|
||||
}
|
||||
uint16_t total = (uint16_t)((uint32_t)p->conn->rtt_last + p->cumulative_rtt);
|
||||
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "chain_rtt: nid=%016llx PATH %s rtt=%u+cum=%u=%u best=%u",
|
||||
(unsigned long long)nq->node_id, p->conn->log_name, p->conn->rtt_last, p->cumulative_rtt, total, best);
|
||||
if (total < best) best = total;
|
||||
}
|
||||
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "chain_rtt: nid=%016llx RESULT=%u(0x%04X)", (unsigned long long)nq->node_id, best, best);
|
||||
return best;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user