Skip to content

reliable 1.4.3: fragment arithmetic in 64 bits, and configurations that cannot fit a packet are refused

Choose a tag to compare

@gafferongames gafferongames released this 10 Sep 17:44
9990cc0

Fragment arithmetic is 64-bit where it sizes a packet, and a configuration that cannot fit a packet length is refused at endpoint create instead of overflowing on the first packet. The last-fragment length, the bounds check that guards its copy, the reassembly offset and the receive gate are computed in 64-bit or size_t; the config check refuses max_fragments times fragment_size above INT_MAX, a negative packet_header_size, and a packet_header_size plus max_packet_size that does not fit an int; the reassembly buffer carries eight bytes of tail slack so a reader that loads an eight-byte window stays inside it on a full last fragment; and the bandwidth totals accumulate in 64-bit. Reassembled bytes are unchanged, nothing on the wire changes, and no symbol changes. Tests cover the refused configurations and the boundary geometries.