- Rename NAT types: OPEN->EIM, RESTRICTED->STRICT across all code
- Add flat addr list {type,ip,port,socket_id} to NODEINFO (NODEINFO_IPV4_ADDR)
- Add NODEINFO_IPV4_SOCKET_META for per-socket metadata
- Add NODE_CONNECTIVITY with per-type probe status and min_rtt
- New module: route_connectivity.c/h (probing engine with socket fallback)
- STRICT verified addresses excluded from NODEINFO broadcast
- Trigger probing on new/updated BGP node, cancel on remove/withdraw
- Update NAT type names in etcpmon GUI
- 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
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.
- route_bgp_send_nat_info: moved ip_to_str(pkt->nat_ip) log before etcp_send
- route_bgp_send_nat_check_req: moved ip_to_str(pkt->interface_ip) log before etcp_send
Both were reading from pkt memory that could be freed by etcp_send callback.
req_pkt memory could be freed by etcp_send callback before pending->request_id
was assigned. Store request_id in local variable and use it for pending.
- Changed request_id from uint64_t to uint32_t in BGP_PING_REQUEST/RESPONSE
- Added uint16_t reserved field after subcmd for proper alignment
- Updated next_ping_req_id from uint64_t to uint32_t in ROUTE_BGP
- Fixed all log format strings from %016llx to %08x
- All 26 tests passing
- 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