- Add acked_bytes/acked_packets to struct ETCP_LINK (init, reset, increment per ACK)
- Add DEBUG_CATEGORY_BBR (23) for BBR-specific debug output
- Add BBR input/output DEBUG_DEBUG around bbr_main call in etcp_ack_recv
- Add "bbr" category name to debug_config and etcpmon GUI
Check queue_find_data_by_index(ack_q) before creating a new ACK_PACKET
in ETCP_SECTION_PAYLOAD handler. Previously every duplicate packet
created a new entry in ack_q, and with links blocked (inf_block) the
queue grew without bounds.
- etcp_conn_reset: queue_resume_callback after clear_queue (input_queue,
input_send_q, input_wait_ack) to prevent suspended callback deadlock
- is_connection_established: check conn->initialized (reliable across
reinit) instead of link->initialized (never cleared on reinit)
- test: force etcp_conn_reinit after server recreation so conn_ok
waits for fresh INIT handshake
- test: guard send_packets() with is_connection_established in reconnect
phases to avoid sending data while conn is down
- etcp_link_update_inflight_lim: self-contained method with clamping,
send_blocked_inflight check, loadbalancer_link_ready on cwnd increase
- etcp_conn_on_inflight_lim_changed: recalc optimal_inflight + resume input
- etcp_ack_recv: use etcp_link_update_inflight_lim instead of manual set
- etcp_request_pkt: fix line 928 check old link (inf_pkt->last_link) not new
- etcp_link_close: recalc optimal_inflight on link removal (both branches)
- etcp_socket_remove: fix dangling pointer loop (nullify after close)
- uasync_print_resources: show timer names, remain time, deleted entries
- diagnostics in utun_instance_destroy and test_etcp_reconnect
memory_pool: memory_pool_is_freed(pool,obj) — поиск obj в free-списке
tw_pcbs (3 места): !ctx→halt и is_freed→halt в начале итерации
— ловит висячий PCB до re-alloc и после re-alloc
etcp: is_freed→halt перед etcp_conn_input (caller + callee)
— ловит pkt освобождённый до входа
tcp_alloc: убран старый скан tw_pcbs (заменён на is_freed)
все dangling проверки — halt (while(1)) вместо break/return
- etcp_conn_reset: cancel retrans_timer/ack_resp_timer via uasync_cancel_timeout
before nulling (was leaking timer handles, confirmed by 'Timer leak: diff')
- etcp_connections: cancel link->init_timer explicitly when link_state becomes 3
on both client and server INIT_RESPONSE paths (prevents spurious INIT after
connection is established that could trigger cascading reinits)
- etcp_connections: remove duplicate conn->session_id assignment in new conn path
(session_id is set later via conn_reinit flow)
- pkt_normalizer: resume output queue callback after pn_reset
- Add test_etcp_reconnect with reinit detection — monitors conn->reinit_count
and restarts data transfer if reinit occurs during active phase
- Add etcp_dump.c/h — ETCP connection state dump utility for debugging
When peer's random session_id changes, etcp_conn_reinit() is called.
Previously NAT check status was not reset, so route_bgp_new_conn()
skipped NAT re-detection because nat_check_status was still
NAT_CHECK_IN_PROGRESS from the previous session.
Now etcp_conn_reinit():
- Cancels pending NAT-ping requests via route_ping_cancel_for_conn()
- Resets nat_type and nat_check_status to UNKNOWN/NONE for all links
This ensures NAT type is re-detected for all links after reinit.
- Added 32-bit session_id to ETCP_CONN struct (random per client)
- Session_id transmitted in INIT_REQUEST/RESPONSE after node_id
- Server: skip reinit if session_id matches existing connection
- Server: send INIT_RESPONSE (0x03) only when reinit actually done
- Server: send INIT_RESPONSE_NOINIT (0x05) for same session
- Client: ignore INIT_RESPONSE with wrong session_id
- Fixed tx_state initialization in etcp_conn_ready for noinit case
- All 26 tests passing
1. Добавлен via_conn в struct route_ping_pending - отслеживает через
какое соединение (third_conn) отправлен запрос на ping
2. route_ping_cancel_for_conn теперь отменяет pending при падении ЛЮБОГО
из двух conn: владельца линка (link->etcp) ИЛИ third_conn (via_conn)
3. nat_link_check_cb проверяет link->nat_check_status == IN_PROGRESS
перед обработкой - защита от race condition когда conn упал раньше
чем пришел ответ
4. Убраны избыточные DEBUG-логи, оставлены только информативные
- Исправлена критическая ошибка: использовалось na->link->conn вместо
na->link->etcp (struct ETCP_LINK.conn = ETCP_SOCKET*, а .etcp = ETCP_CONN*)
- Добавлен подробный дебаг в 4 места:
* route_ping_send_req_addr - при создании pending
* route_ping_cancel_for_conn - при поиске и отмене
* route_bgp_remove_conn - состояние линков перед отменой
* etcp_connection_close - очистка линков при закрытии
- Add rx_dup_count (local) and tx_dup_count (remote via ACK) to ETCP_CONN
- Extend ACK section format: add 16-bit rx_dup_count after last_delivered_id
- Reconstruct 32-bit tx_dup_count from received 16-bit diff
- Update etcpmon protocol and control_server to expose counters
- Update packet dumper for new ACK format