Add a configASSERT() that checks the gateway address is on the same subnet as the device in FreeRTOS+UDP.

This commit is contained in:
Richard Barry 2013-10-14 14:35:53 +00:00
parent 94607d83f9
commit 6280324778

View file

@ -581,6 +581,10 @@ static portBASE_TYPE xReturn = pdFALSE;
#else
{
*ipLOCAL_IP_ADDRESS_POINTER = xNetworkAddressing.ulDefaultIPAddress;
/* Ensure the gateway is on the same subnet as the IP
address. */
configASSERT( ( ( *ipLOCAL_IP_ADDRESS_POINTER ) & xNetworkAddressing.ulNetMask ) == ( xNetworkAddressing.ulGatewayAddress & xNetworkAddressing.ulNetMask ) );
}
#endif /* ipconfigUSE_DHCP == 1 */