Skip to content

Improve ARP buffer allocation sizing and ICMPv6 NS validation ordering#1330

Merged
patrzhan merged 1 commit intoFreeRTOS:mainfrom
patrzhan:dev/improvements
Apr 13, 2026
Merged

Improve ARP buffer allocation sizing and ICMPv6 NS validation ordering#1330
patrzhan merged 1 commit intoFreeRTOS:mainfrom
patrzhan:dev/improvements

Conversation

@patrzhan
Copy link
Copy Markdown
Member

@patrzhan patrzhan commented Apr 9, 2026

Description

Two improvements to buffer handling:

  1. FreeRTOS_ARP.c: In FreeRTOS_OutputARPRequest_Multi(), the buffer allocation now uses FreeRTOS_max_size_t() to request the larger of sizeof(ARPPacket_t) and ipconfigETHERNET_MINIMUM_PACKET_BYTES, ensuring the allocated buffer is always large enough for the subsequent padding loop.

  2. FreeRTOS_ND.c: In the Neighbor Solicitation case of prvProcessICMPMessage_IPv6(), the buffer size validation is reordered to occur before accessing the xIPv6Address field.

Test Steps

  1. Build and run existing unit tests — no regressions.
  2. Verified ARP request path sends correctly with both BufferAllocation_1 and BufferAllocation_2.
  3. Verified ICMPv6 Neighbor Solicitation processing with valid and undersized packets.

Checklist:

  • I have tested my changes. No regression in existing tests.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request.

Related Issue

N/A

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

@patrzhan patrzhan force-pushed the dev/improvements branch 3 times, most recently from 77f00d8 to b04d4ca Compare April 9, 2026 23:44
@patrzhan patrzhan merged commit da707f2 into FreeRTOS:main Apr 13, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants