mirror of
https://github.com/n0-computer/noq.git
synced 2026-09-23 19:48:19 +00:00
5ce48e1897
When a frame contained data for an offset of 0, the transmit logic did not fully fill a packet. The reason for this is that the logic reserved 1 byte for writing an offset. However storing offset 0 doesn't require 1 byte, because it will be encoded with a special flag in the message header. Without GSO, this isn't a huge issue. It mostly means we are wasting 1 byte per datagram. However with GSO, this actually leads to data corruption: When using GSO, and packet isn't fully filled, it later gets padded to MTU size. Padding a packet ending with a STREAM frame that doesn't contain a length information is however invalid, and will let the receiver assume the padding is part of part of the data. This means the receiver will receive an extra `0` at the end of a stream - and depending on the duplicate detection at the receiver either the 0 or the correct byte in the next packet will win.