Assert fail using zero copy buffers porting FreeRTOS-Plus-TCP V3.1.0 to V4.2.2

Greetings,
I successfully ported our app from FreeRTOS-Plus-TCP V3.1.0 to V4.2.2. Our app is working as it did running V3.1.0 however it is necessary to comment out the line:

vPreCheckConfigs( )

in

BaseType_t FreeRTOS_IPInit_Multi( void )

The following two asserts fail:

configASSERT( ipBUFFER_PADDING >= 10U );
configASSERT( ( ( ( ipSIZE_OF_ETH_HEADER ) + ( ipBUFFER_PADDING ) ) % 4U ) == 0U );

We have been using an implementation of zero copy buffers all the way back to when we started using the stack (Build 160112 in 2016). Our configuration has:

ipconfigPACKET_FILLER_SIZE = 0
ipBUFFER_PADDING = (8U + ipconfigPACKET_FILLER_SIZE)

As far as I can tell we aren’t now or were prior suffering performance issues or failure related to unaligned access.

I hate to modify library code to use it. Is the check necessary?
Curious to hear your thoughts.

Thanks!

Hi @blanco-ether,

Is there any particular reason for you to custom define ipconfigPACKET_FILLER_SIZE as 0 in your FreeRTOSIPConfig.h?

The reason for the default definition of ipconfigPACKET_FILLER_SIZE as 2 in the FreeRTOSIPConfigDefaults.h is to force the IP header of network packets to start at a 32-bit aligned address (ethernet header is considered to be 14 bytes; adding 2 makes it have the required alignment) so that in most platforms it makes the code more efficient and avoids failures when used with caching enabled.