evgeny
8ddce55d9e
Describe checked datagram startup and bounded TCP HUP handling
2026-10-24 13:54:40 +02:00
evgeny
266f9c59c9
Document atomic proxy client creation and instance shutdown order
2026-10-24 13:52:22 +02:00
evgeny
7c457a075b
Update datagram and TCP exit documentation for explicit ownership
2026-10-24 13:42:20 +02:00
evgeny
4087a99c98
Preserve datagram bindings and verify optional ICMP behavior
2026-10-24 13:38:45 +02:00
evgeny
6cf2176ae0
Roll back required TUN mappings and verify instance startup failures
2026-10-24 13:36:22 +02:00
evgeny
4c73737115
Check UDP socket operations and roll back incomplete flows
2026-10-24 13:25:43 +02:00
evgeny
3301aa2c07
Make TCP proxy construction atomic and retain instance datagrams
2026-10-24 13:24:30 +02:00
evgeny
a0e62ced2e
Separate ICMP exit startup from shared context ownership
2026-10-24 13:23:58 +02:00
evgeny
ebea1abd1a
docs(proxy): record teardown findings and refine counters
2026-10-24 12:39:09 +02:00
evgeny
eb08e41c08
docs(proxy): consolidate current protocol and audit coverage
2026-10-24 12:38:27 +02:00
evgeny
6d759ecacf
docs(proxy): reconcile TCP client server and listener behavior
2026-10-24 12:36:16 +02:00
evgeny
f72246f9e3
docs(proxy): document per-instance datagram contexts
2026-10-24 12:16:47 +02:00
evgeny
c3b894a878
docs(proxy): specify TCP lifecycle and UDP ownership
2026-10-24 12:14:42 +02:00
evgeny
bf6dfe1aa5
docs(proxy): clarify flow control and HTTP parser contracts
2026-10-24 12:13:05 +02:00
evgeny
09a919a606
Fix TUN packet ownership, lifecycle and backend consistency
...
Unify TUN initialization and raw-IP writes, preserve socketpair directions, and bound reader delivery with queue backpressure. Make deferred packet ownership safe across close and uasync teardown, and apply per-interface MTU limits to lwIP MSS.
Validation: full check.sh passed 172 tests, 9 proxy integration checks, burst and load. TUN ASAN/UBSAN regressions passed 30 cases; TCP exchange passed with asymmetric and minimum MTUs. Sanitized NAT integration exposed an existing unaligned uint16_t read in eim_nat.c; that separate defect remains unchanged. Native Windows and FreeBSD validation remains outstanding.
2026-10-21 21:19:42 +02:00
evgeny
1fda1778c9
Initialize proxy timers before notifying connected owners
2026-10-21 16:48:25 +02:00
evgeny
4f855469a1
Fix TCP connect timer ownership and pending FIN state
2026-10-21 16:44:19 +02:00
evgeny
4b42231acb
tests: hold OS-assigned HTTP and SOCKS listener ports
2026-10-10 16:04:19 +02:00
evgeny
5e4e632439
Fix HTTP proxy framing, keep-alive and stream lifecycle
2026-10-05 09:27:23 +02:00
evgeny
ec01131ed8
Improve Android VAD lifecycle, audio settings and diagnostics
2026-10-04 14:36:52 +02:00
evgeny
7c4b909bc7
docs: update file inventory and module header contracts
...
Refresh both AGENTS guides and clarify module purpose, usage, ownership, threading, return values and wire formats in headers. Remove the unused timeout_heap freed_count field and unimplemented getter.
2026-10-04 13:10:01 +02:00
evgeny
1be40b220d
Fix TCP proxy use-after-free during synchronous close
2026-09-30 10:43:02 +03:00
evgeny
4c18dfc067
radio: Silero VAD + auto-PTT; chatgui/android: app icon and background
2026-09-29 16:19:25 +03:00
evgeny
a44dc49287
proxy: rename pcb guard, dedupe abort; tasks: FIN_WAIT_2 leak
2026-09-29 13:52:35 +03:00
evgeny
65a282cbf6
proxy: detach lwIP pcb on local close, guard abort against freed pcb
...
При half-close (exit закрылся первым, браузер держит соединение) pcb уходил в
TIME_WAIT, а conn_finish ждал flow.fin_sent (доставку FIN в exit) — при backpressure
это не наступало, pc->pcb оставался висячим. Таймер TIME_WAIT освобождал pcb без
err_cb, и CLOSE_ALL давал double free. Теперь pcb отсоединяется по завершении
локальной стороны, а tcp_abort/tcp_close защищены проверкой memory_pool_is_freed.
2026-09-29 13:37:00 +03:00
evgeny
634de00031
lwip/proxy: trace PCB lifetime in debug category, drop old noisy debug
2026-09-29 13:18:18 +03:00
evgeny
6517bbeb2d
Preserve proxy TCP streams across connect, backpressure and FIN
2026-09-29 04:00:34 +03:00
evgeny
714579d76e
Release TUN proxy connections when lwIP aborts their PCB
2026-09-29 03:59:30 +03:00
evgeny
597ef924e8
Scope TCP proxy streams and restart messages to their peer
2026-09-29 03:58:53 +03:00
evgeny
3a8ef56b61
Isolate datagram proxy state and replies between instances and peers
2026-09-29 03:58:14 +03:00
evgeny
ca21e458d6
Parse IPv4 options and reject malformed TUN proxy packets
2026-09-29 03:57:37 +03:00
evgeny
fb170e71c4
Validate SOCKS5 authentication and destination addresses
2026-09-29 03:57:21 +03:00
evgeny
14baf6389a
Fix UDP and ICMP packet construction at the TUN boundary
2026-09-29 03:56:55 +03:00
evgeny
cf169d0a6a
tun proxy: фикс TCP-суммы (нечётный pbuf), FIN до дренажа to_lwip, tcp_bind/rexmit_fast/active_pcbs_changed + нагрузочный burst-тест
2026-09-25 23:36:45 +03:00
evgeny
94ec8b6118
proxy/tun: добавить DEBUG-логи диагностики застревания keep-alive (lwIP IN/OUT/RECVED/RTO/PERSIST + per-conn DIAG)
2026-09-25 22:12:47 +03:00
evgeny
58f679c215
uasync: pass socket name to all add_socket call sites
2026-09-20 01:13:38 +03:00
evgeny
42a5f5af86
socks_proxy: defer conn free to fix UAF from synchronous write_queue flush
2026-09-15 22:39:27 +03:00
evgeny
3f0870198a
tcp_io: fix error_cb busy-spin on graceful EPOLLHUP; socks_proxy: close local socket on both FINs
...
- error_cb (tcp_io): при graceful HUP (SO_ERROR==0) после уже прочитанного FIN
сокет оставался в epoll и level-triggered EPOLLHUP крутил цикл на 100% CPU.
Теперь сокет закрывается через tcp_conn_push_close.
- socks_proxy on_fin_cb: при обоих обменянных FIN локальный сокет закрывается
(send_close + push_close), симметрично exit-стороне (tcp_proxy_server).
2026-09-12 16:08:14 +03:00
evgeny
1db97bd5af
etcp_router: разделить служебные функции и API в хедере + чистка мёртвого кода
...
- etcp_router.h: 4 секции (протокол / внутренние структуры / API / служебные)
- переименование router_set_max_inflight -> etcp_router_set_max_inflight
- удалены неиспользуемые: input_q_count, waiter_register/cancel, conn_close_async
(+ поля close_callback/close_callback_arg)
- docs: актуализировать backpressure (on_send_ready на send_q) вместо удалённого waiter API
2026-09-05 22:34:00 +03:00
evgeny
8b92cd24c6
etcp_router: вынести подпись/шифрование в route_crypto, одна функция отправки с флагами
...
- route_crypto_encode/decode: автономный пред/пост-обработчик пакета
(encrypt-then-sign, стандартный Ed25519 вместо sc_stream_sign)
- одна функция отправки etcp_route_send/etcp_router_conn_send с bitmask mode
- формат доставки: [svc_id][src][dst][rx_flags][payload] (статус подписи/шифрования)
- ROUTER_INFLIGHT хранит финальный wire-пакет (чинит потерю подписи при ретрансмите)
- дедуп инициализации: router_conn_reset/free_queues
- учёт inflight через inflight_q count (seq присваивается на enqueue)
2026-09-05 17:40:43 +03:00
evgeny
73bdea5d0e
socks_proxy: fix client stall + non-blocking DNS via async_dns
...
- fix HTTP_STATE_RELAY == SOCKS_STATE_CONNECTING enum collision (relay data dropped)
- fix wrong waiter cancel (etcp_router_waiter_cancel -> etcp_router_cancel_send_ready)
- add backpressure retry timer, restore lost queue_resume_callback, defer FIN on pending tx_buf
- async_dns: /etc/hosts fast-path + hosts loading (avoid 4s DNS timeout for localhost)
2026-09-03 18:13:00 +03:00
evgeny
0b10c78ff0
tcp_proxy: fix throughput (tx_queue backpressure) + connect timeout + integration test
...
- Router: unified service delivery format [svc_id][src][dst][payload] (end-to-end src/dst from SVC_ROUTE header)
- tcp_proxy_client: replace single tx_buf drop-on-backpressure with bounded tx_queue + send_q waiter + retry timer (no data loss, bulk window reopen — removes 62.5ms delayed-ACK stall)
- tcp_io: configurable connect timeout (tcp_conn_set_connect_timeout)
- tcp_proxy_server: connect_timeout config option (ms, default 2000, 0=off)
- check.sh: run tcp_proxy_full integration test with sudo (skip if passwordless sudo unavailable)
- test_tcp_io: connect timeout unit test; docs (lwip_nuances.md)
2026-09-03 13:49:09 +03:00
Evgeny
4c46b88631
tcp_proxy_client: fix pcb double-free — завершать conn при обоих FIN, не держать pc->pcb до TIME_WAIT
2026-08-15 09:30:03 +03:00
Evgeny
2bec7c7afe
proxy: guard if_indextoname bind block for Windows (_WIN32)
2026-08-13 19:35:13 +03:00
Evgeny
78b4305202
proxy: fix double-free on exit-side tcp error (re-entrant loopback)
2026-08-12 22:51:14 +03:00
Evgeny
d0a433bfe7
tcp_proxy_server: fix reentrant UAF in read_queue_drain_cb via loopback
2026-08-10 22:25:16 +03:00
Evgeny
96a8312797
config_parser: add missing tcp_proxy_server options (fib, so_mark, netif, bind_ip); tcp_proxy_server: move diag log to TRACE
2026-08-10 22:07:12 +03:00
Evgeny
7650b93d29
tcp_proxy: split svc_id into SERVER(0x04) and CLIENT(0x08), fix loopback conn=NULL
2026-08-10 22:00:39 +03:00
Evgeny
173bd485c1
tcp_proxy_server: add fib/so_mark/netif/bind_ip socket options
2026-08-10 20:12:07 +03:00
evgeny
2b27594ced
add proxy server/client indicator (S/C) in connection monitor
2026-08-10 10:30:07 +03:00