Skip to content

Commit 429c28a

Browse files
fix IP buffer padding check on 64bit (#146)
* fix IP buffer padding check on 64bit On 64 bit systems, FreeRTOS_IPInit() would assert ipconfigBUFFER_PADDING was equal to 14 to "make sure there is enough space in pucEthernetBuffer to store a pointer." This prevents the driver from requesting additional padding, so make the assert greater than or equal to 14. Also use the final ipBUFFER_PADDING value instead of ipconfigBUFFER_PADDING, which is probably what was intended? * Update after comments Co-authored-by: Thomas Pedersen <[email protected]> Co-authored-by: Aniruddha Kanhere <[email protected]>
1 parent 7df143c commit 429c28a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

FreeRTOS_IP.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,10 @@ BaseType_t FreeRTOS_IPInit( const uint8_t ucIPAddress[ ipIP_ADDRESS_LENGTH_BYTES
11401140
{
11411141
/* This is a 64-bit platform, make sure there is enough space in
11421142
* pucEthernetBuffer to store a pointer. */
1143-
configASSERT( ipconfigBUFFER_PADDING == 14 );
1143+
configASSERT( ipconfigBUFFER_PADDING >= 14 );
1144+
1145+
/* But it must have this strange alignment: */
1146+
configASSERT( ( ( ( ipconfigBUFFER_PADDING ) + 2 ) % 4 ) == 0 );
11441147
}
11451148

11461149
/* Check if MTU is big enough. */

0 commit comments

Comments
 (0)