Evgeny
f691c01b45
перевод комментариев tcp/udp/icmp proxy на русский
4 months ago
Evgeny
9a5d8797af
tun: socket pair in test_mode, remove ip_fd_mode from tcp_proxy, fix test_remote_proxy stream_id size
4 months ago
Evgeny
d1c9ef8377
ag
4 months ago
Evgeny
e5d11ef9c1
refactor tcp_proxy: remove local socket mode, simplify architecture
...
- remove sock_transport, transport abstraction, active connections API
- simplify proxy_conn to 13 fields (was 15), remove tcp_proxy_mapping linked list
- new protocol: stream_id 4B, seq 2B cyclic, HDR_SIZE 8B
- add ERROR subcmd for immediate abort, CLOSE for graceful half-close
- proper half-close: shutdown SHUT_WR, keep reading, no timer
- exhaustive DEBUG_ERROR/WARN on all error/unusual branches
- config parser: report unknown options with filename:line and valid keys
4 months ago
Evgeny
c3eccd7b35
add backpressure support: uip_retry_timer, feed drain at closing_tun/sent, send buffering with retry
...
- proxy_uip_retry_cb: retry send from uip_to_transport every 5ms
- proxy_recv_cb: buffer to uip_to_transport when send fails, set retry timer
- proxy_feed: drain transport_to_uip when closing_tun || closing_sent (prevents RST)
- proxy_recv_cb(p==NULL): only tcp_recved + closing_tun, no drain
- proxy_poll_cb/tcp_proxy_destroy: cancel retry timer on cleanup
- uip_retry_timer field in proxy_conn
4 months ago
Evgeny
616986457f
add DEBUG_ERROR in all silent proxy error paths: NULL checks, alloc fails, transport send fail, data drop
4 months ago
Evgeny
10b9c93fcb
add SOCK:EVENT unified diagnostics on exit: NEW/CONN/SEND/RECV/CLOSE/TIMER with fd, stream, total count
4 months ago
Evgeny
be791ee7b2
drain transport_to_uip at FIN to prevent data delivery after close (eliminates RST storm)
4 months ago
Evgeny
01254406d8
fix tun_platform_write return value on FreeBSD: subtract 4-byte AF_INET header from writev result
4 months ago
Evgeny
c4b1436919
add TUN write hex dump diagnostic (ip_total, ver_ihl, proto, first 32 bytes hex) in traffic category
4 months ago
Evgeny
f708b1d095
add TUN write diagnostic: log tun_platform_write errors
4 months ago
Evgeny
deaeae747a
remove feed block after CLOSE: feed must remain active for streaming and half_close after FIN
4 months ago
Evgeny
4b7a1656fc
final RST fix: tcp_recved before closing_tun, feed stop after CLOSE, free unsent before tcp_close, proxy_try_close helper
...
- proxy_recv_cb(p==NULL): tcp_recved(pcb,gap) before closing_tun
- proxy_feed_from_transport: stop when closing_sent
- proxy_poll_cb cleanup: free unsent before tcp_close
- proxy_try_close helper: shared between poll_cb (500ms) and recv_cb
- pending_out check: don't close if data still queued for exit
- Configs: traffic=info, tun=info for diagnostics
4 months ago
Evgeny
40d35ee2a5
fix RST storm: stop proxy_feed after CLOSE sent + free unsent before tcp_close
4 months ago
Evgeny
80e4e4fd5d
fix RST on FIN: tcp_recved in proxy_recv_cb BEFORE closing_tun, guard proxy_err_cb with !closing_sent
4 months ago
Evgeny
8de8b5bb41
fix RST storm: tcp_recved before tcp_close in proxy_poll_cb cleanup
4 months ago
Evgeny
7c668b5d6c
add lwIP state diagnostics: tcp_alloc cwnd/sndbuf, proxy_poll_cb cwnd/unsent/unacked, active_pcbs counter
4 months ago
Evgeny
ba03cab182
fix tcp_proxy connection lifecycle: closing_sent, destroy transport, shutdown+timer on exit
...
- Add closing_sent flag to proxy_conn (CLOSE sent to exit, no need to wait for reply)
- proxy_poll_cb: send CLOSE when done || sndbuf==0; cleanup when tun && (rem||sent)
- Destroy transport in proxy_poll_cb cleanup (fix 56-byte leak)
- remote_proxy_handle_close: shutdown(SHUT_WR) + 2s timer instead of immediate rp_conn_free
- Remove SHUTDOWN subcommand entirely (not needed with new lifecycle)
4 months ago
Evgeny
ca3215ab91
fix half_close: send CLOSE from proxy_poll_cb when no pending data, shutdown not close on exit
4 months ago
Evgeny
f9d5495993
fix tcp_proxy deadlock: send CLOSE on TUN FIN + full proxy diagnostics
...
- proxy_recv_cb(p=NULL): now calls transport->close() to signal exit side
- Add PROXY FIN/CLOSE/CONNECTED/DATA/FEED/TCP_IN/TCP_OUT logs
- Add RP RECV/SEND/CLOSE logs on exit side
- Fix queue_dgram_free/queue_entry_free ordering (UAF) in all proxy files
- Change TRAFFIC logs from ERROR to INFO level
- Add 2 extra 1MB tests in run_test.sh to verify no post-stress stall
- stress_client.py: add --verbose per-thread timing (connect/send/recv ms)
- mem.c: zero freed memory for early UAF detection
4 months ago
Evgeny
4e6d57e371
clear freed memory in u_free_impl to catch UAF earlier
4 months ago
Evgeny
a02c474b94
fix use-after-free in queue_entry_free/dgram_free ordering + add tcp_proxy stress test + proxy diagnostics logging
...
- Fix queue_entry_free before queue_dgram_free in all proxy files (UAF bug causing segfault)
- Add PROXY/RP prefixed diagnostic logs for transparent proxy flow tracking
- Add tcp_proxy integration test: real utun instances, ETCP, remote_proxy, DNAT routing
- 7 test scenarios: basic_1mb, concurrent_5, concurrent_20, half_close, idle, conn_refused, stress (10 threads x 20 iterations)
- stress_client.py with --verbose per-thread phase timing (connect/send/recv)
4 months ago
Evgeny
2585ef6f29
set FreeBSD TUN remote address to 192.0.2.1 instead of same as local
4 months ago
Evgeny
6521451493
disable BACKTRACE_ENABLED to fix lld linker error with backtrace symbols
4 months ago
Evgeny
2144eea46f
fix compiler warnings: C23 label+declaration, uint16_t overflow check
4 months ago
Evgeny
7c71ef683c
add lwIP TCP stack test with fixes: rcv_wnd tracking, FIN compensation, tmr_phase dual-counter, trace ring buffer, stats counters
4 months ago
Evgeny
8994d7a834
update timeout_heap and u_async: O(1) cancel, heap cancel bubble-up fix, epoll callback safety, uasync_stop, socket_array u_realloc
4 months ago
Evgeny
2d516bf16e
fix route_bgp etcp_send leaks and etcp_socket_remove infinite loop on link->conn==NULL
5 months ago
Evgeny
6c2aeb69a1
fix INIT bounds checks and eim_nat port uint16_t wrap
5 months ago
Evgeny
d6c6ca9eb3
fix route_bgp/route_ping: old paths queue leak, etcp_send fail leak, nat_check_arg leak on cancel
5 months ago
Evgeny
5aa9bdbd64
fix pkt_normalizer: null deref on alloc fail, mtu underflow, unchecked pn_buf_renew in loop
5 months ago
Evgeny
194c8398c1
fix ETCP: dgram leak on inflight pool exhaustion, cancel dangling timers on link close/new
5 months ago
Evgeny
4d5afe5ae9
fix uasync: posted_tasks delivery on Linux, create cleanup leaks, atomic array expand
5 months ago
Evgeny
06b94d37e8
add audit findings document (51 issues across 12 modules)
5 months ago
Evgeny
1a4b0a9de6
fix stale pointer after realloc in uasync socket/event handlers
5 months ago
Evgeny
f18037ece2
add 16-bit seq to TCP proxy DATA for loss/duplicate detection
5 months ago
Evgeny
b829ff7001
fix use-after-free in tests: swap queue_entry_free/queue_dgram_free order, fix dangling timer handles and stack args; add ETCP MTU bounds, assembly overflow check, etcp_update_mtu
5 months ago
Evgeny
60cebb2535
fix TCP data stall: feed transport_to_uip on ETCP recv, tcp_poll interval 0→2 for close detection
5 months ago
Evgeny
3258a64df4
add periodic cleanup timers for ICMP pending requests and UDP flows
5 months ago
Evgeny
cec736a4b0
redesign TCP close: closing_tun/closing_rem flags, poll-driven cleanup, proper half-close
5 months ago
Evgeny
238fb0eb23
fix remote_proxy: cleanup socket on EOF/error/connect-fail to prevent infinite callback loop
5 months ago
Evgeny
f1bd65f450
fix lwIP TCP checksums on LE: remove htons from pseudo-header sum, add htons to return values
5 months ago
Evgeny
f85f2f20fb
fix tcp_pseudo_checksum: add ntohs() to correctly extract 16-bit IP halfwords from NBO on LE
5 months ago
Evgeny
b1e50c2838
fix tcp_proxy_ensure_outbound_listen: pass network byte order port to tcp_bind
5 months ago
Evgeny
76e916f94d
add transparent outbound TCP proxying: dynamic listen on unknown ports, fwd to exit
5 months ago
Evgeny
01cf7f67b6
fix TCP close: properly close lwIP pcb on both sides, fix use-after-free, add poll close path
5 months ago
Evgeny
c396b91fde
fix missing IP checksum in icmp/udp deliver_reply, fix udp output_queue->input_queue
5 months ago
Evgeny
889f6d5c3a
fix icmp_proxy: write reply to input_queue (not output_queue) to reach TUN device
5 months ago
Evgeny
13d469d866
add orig_src_ip to ICMP proxy protocol, fix deliver_reply dst_ip (was wrong tun_ip_addr)
5 months ago
Evgeny
67d57c9751
add etcp_router INFO logs for ICMP_PROXY reply path (send+deliver)
5 months ago