Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BufferAllocation_2: respect 0 length buffer request (#265)
* BufferAllocation_2: respect 0 length buffer request The pxGetNetworkBufferWithDescriptor() documentation states: If xRequestedSizeBytes is zero then the returned network buffer descriptor will not reference an Ethernet buffer (the reference is set to NULL). But this did not match the implementation. 2 bytes were unconditionally being added to the requested size, and the returned NetworkBufferDescriptor_t would have a nonzero pucEthernetBuffer. Move the code performing length alignment as is into the branch checking whether size is nonzero. This lets the caller request a bare NetworkBufferDescriptor_t to eg. implement zero copy RX. * BufferAllocation_2: initialize NetworkBuffer data length on free Co-authored-by: Aniruddha Kanhere <[email protected]>
- Loading branch information