ostp/ostp-client
ospab 3d2b9236e1 fix(tun): reassemble IPv4 fragments so large UDP (games) is not dropped
The user's game (Roblox) disconnected on join while the menu was fine. The log
showed the cause directly, over and over:

  ERROR netstack_smoltcp::udp: invalid err: wire::Error,
        src_ip: 10.1.0.2, dst_ip: 13.249.8.109, payload: [~1400 bytes]

The userspace netstack parses each IP packet and runs UdpPacket::new_checked on
its payload. An IP *fragment* passes the IP check but fails the UDP one — the
UDP length field describes the whole datagram while the fragment holds only a
slice — so smoltcp drops it with wire::Error. Large UDP datagrams (a game
sending >MTU packets that the OS fragments on the way to the TUN) therefore
vanished entirely and the game timed out. smoltcp 0.2.2 does no reassembly.

Adds an IPv4 reassembler between the TUN read and the netstack: fragments are
buffered by (src, dst, id, proto) with a 3s timeout and a group cap, and only a
fully reassembled datagram — header fixed up (fragment fields cleared, total
length and checksum recomputed) — is handed on. Non-fragmented packets pass
through untouched. Wired into both the Windows and Linux tun→stack loops.

The reassembly logic is pure and unit-tested (in-order, out-of-order,
pass-through, incomplete-group, checksum). End-to-end behaviour still needs the
user's live TUN to confirm, since that cannot be exercised here.
2026-08-19 19:11:35 +03:00
..
src fix(tun): reassemble IPv4 fragments so large UDP (games) is not dropped 2026-08-19 19:11:35 +03:00
Cargo.toml §A: remove WSS + Reality (TLS-mimicry); bump to 0.4.0 / AGPL-3.0 2026-06-27 16:29:42 +03:00
test_udp.rs fix: remove DNS interception on server, fix TUN routing on Windows and Linux 2026-05-28 12:30:06 +03:00