52f32da replaced direct inflight_lim_bytes assignment and inline
optimal_inflight recalculation with etcp_link_update_inflight_lim()
+ BBR on_cwnd_update callback. This broke test_etcp_reconnect
(flaky FAIL in phase 4, recv=0 after server restart).
Revert etcp_connections.c/h back to inline init. Keep BBR callback
infrastructure (etcp_bbr.c/h) and IPv6/sockaddr changes
(config_parser, utun_instance) which are harmless.
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
Shows mtu, s_rand, s_max, offset/xoffset, and whether capped.
RESP: removed old hardcoded 1472+26 cap, replaced by formula.
Both paths use consistent formula based on #defines.
Hardcoded 1472-46 cap exceeded link MTU=1460, causing 'packet too long'
error on INIT handshake. Use link->mtu - UDP_HDR_SIZE - offset - 19
instead of fixed 1472.
- link_status теперь требует двусторонней слышимости: remote && local
- recv_keepalive восстанавливается ДО вычисления link_status (избегает заклинивания)
- loadbalancer_link_ready по переходу 0→1 с проверкой was_up
- UDP proxy: datagram relay client↔exit over ETCP
- ICMP proxy: echo ping relay client↔exit over ETCP
- Move via_node_id from per-forward-mapping to global tcp_proxy setting
- Support multiple concurrent tcp_proxy instances (no singleton g_tcp_proxy)
- Cap handshake padding to stay within 1472+overhead
- Handle non-TCP packets (UDP/ICMP) in tcp_proxy raw/tun input paths
- Add utun_instance_create_from_str() for test config creation
- 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
- etcp_connections.c:1142: remove & before addr in sockaddr_storage_to_str call
- test_etcp_simple_traffic.c: add #include <process.h> and #define getpid _getpid for Windows
The allowed_keys authorization was incorrectly checking all INIT-decrypted
packets including PING/PONG. Moved the check after packet type validation
so it only applies to ETCP_INIT_REQUEST/NOINIT (incoming connection requests).
Fixes test_etcp_ping and test_nat_detection failures.
- Add lib/getmyip.c/h with get_outgoing_local_ip() using UDP connect+getsockname
- Update etcp_socket_add() to use new function for 0.0.0.0 and :: bindings
- Support both IPv4 (8.8.8.8) and IPv6 (2001:4860:4860::8888) auto-detection
- Remove broken get_default_route_ip() from platform_compat (it returned gateway IP, not local IP)
- Keep get_interface_ip_by_index() for explicit interface bindings
- Update Makefile.am to include new getmyip module
- New lib/getmyip.c/h with get_outgoing_ip(), get_default_local_ip(), get_local_ip_by_index()
- Uses UDP connect + getsockname instead of /proc/net/route parsing
- Supports both IPv4 and IPv6
- Updated etcp_socket_add() to use new functions for interface_addr detection
- Added CFG_ALLOWED_KEY struct with binary key storage (64 bytes) for fast memcmp comparison
- Implemented parsing of [allowed_keys] section with allow_all flag and per-key entries
- Added key validation in etcp_connections.c server handler (errorcode=8 for rejected keys)
- Default behavior: deny all if [allowed_keys] section is missing or allow_all=0 with no keys
- Added proper memory cleanup and debug logging for allowed_keys configuration
- Updated all test configs to include [allowed_keys] allow_all=1 for backward compatibility
- 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
- etcp_connections.c: парсинг NAT IP через memcpy (сохраняет NBO)
- route_bgp.c: убраны ntohl() для IP в NAT detection и route_bgp_send_nat_info
- route_ping.c: убран htonl() для IP в ping request
- тесты: обновлены ожидания NBO для nat_ip
- platform_compat: get_interface_ip_by_index() для получения IP по ifindex
- ETCP_SOCKET: interface_addr заполняется из конфига/interface/default route
- BGP_NAT_CHECK_REQ: добавлены interface_ip/interface_port (network byte order)
- route_bgp_send_nat_check_req: отправляет interface_addr линка
- route_bgp_handle_nat_check_req: принимает interface данные в sockaddr-заглушку