FreeRTOS / FreeRTOS-Plus-TCP

FreeRTOS-Plus-TCP library repository. +TCP files only. Submoduled into https://github.com/FreeRTOS/FreeRTOS and various other repos.
MIT License
125 stars 149 forks source link

Repair ARP unit tests #1116

Closed tony-josi-aws closed 3 months ago

tony-josi-aws commented 3 months ago

Description

This PR fixes few ARP unit tests which were accessing packet memory outside of allocated bounds. Here the packet size is ensured to be ipconfigETHERNET_MINIMUM_PACKET_BYTES, to make sure that the ethernet buffer passed should be having size >= ipconfigETHERNET_MINIMUM_PACKET_BYTES. As in normal scenario, the remaining size more than the ARP packet size would be filled by the IP stack.

Test Steps

Checklist:

Related Issue

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

moninom1 commented 3 months ago

Can you please add more details to the description according to our discussion, to make it more clear why we are making ARP packet of size ipconfigETHERNET_MINIMUM_PACKET_BYTES.

tony-josi-aws commented 3 months ago

@moninom1

If ipconfigETHERNET_MINIMUM_PACKET_BYTES is defined, then the ethernet buffer passed should be having size >= ipconfigETHERNET_MINIMUM_PACKET_BYTES, as the remaining size more than the ARP packet size would be filled by the IP stack.