I just downloaded the FreeRTOS-Plus-TCP source code from github: https://github.com/FreeRTOS/FreeRTOS-Plus-TCP for comparing with the one I am using.
I saw that in prvAllowIPPacketIPv4() function in FreeRTOS_IPv4.c, you are checking for source IP address to be Broadcast address only when endpoint is up.
else if( FreeRTOS_IsEndPointUp( pxEndPoint ) != pdFALSE )
{
if(
/* Not destined for the assigned endpoint IPv4 address? */
( ulDestinationIPAddress != pxEndPoint->ipv4_settings.ulIPAddress ) &&
/* Also not an IPv4 broadcast address ? */
( ulDestinationIPAddress != pxEndPoint->ipv4_settings.ulBroadcastAddress ) &&
( ulDestinationIPAddress != FREERTOS_INADDR_BROADCAST ) &&
/* And not an IPv4 multicast address ? */
( xIsIPv4Multicast( ulDestinationIPAddress ) == pdFALSE ) )
{
/* Packet is not for this node, release it */
eReturn = eReleaseBuffer;
}
/* Is the source address correct? */
else if( ( ulSourceIPAddress == pxEndPoint->ipv4_settings.ulBroadcastAddress ) ||
( ulSourceIPAddress == FREERTOS_INADDR_BROADCAST ) )
So, I just came here to ask out of curiosity as to why write there, it could also be written before that else if statement.