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
152 stars 163 forks source link

Set ipBUFFER_PADDING to 14 bytes by default on 64 bit targets v2 #1061

Closed htibosch closed 10 months ago

htibosch commented 11 months ago

Description

While looking at old un-merged PRs I saw PR #547: "Set ipBUFFER_PADDING to 14 bytes by default on 64 bit targets".

Mentioned PR had the following description: If ipconfigBUFFER_PADDING is not defined in FreeRTOSIPConfig.h, builds for 64 bit targets fail. Add a default value of 14 bytes ( 12U + ipconfigPACKET_FILLER_SIZE ) for ipBUFFER_PADDING to satisfy the alignment check in FreeRTOS_IP_Utils.c.

The change in FreeRTOS_IP.h:

     /* Use setting from FreeRTOS if defined and non-zero */
     #if defined( ipconfigBUFFER_PADDING ) && ( ipconfigBUFFER_PADDING != 0 )
         #define ipBUFFER_PADDING    ipconfigBUFFER_PADDING
+    #elif ( UINTPTR_MAX > 0xFFFFFFFF )
+        #define ipBUFFER_PADDING    ( 12U + ipconfigPACKET_FILLER_SIZE )
     #else
         #define ipBUFFER_PADDING    ( 8U + ipconfigPACKET_FILLER_SIZE )
     #endif

The PR was reviewed, approved, and then somehow forgotten.

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.