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

pull/4/head
Richard Barry 11 years ago
parent 94607d83f9
commit 6280324778

@ -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 */

Loading…
Cancel
Save