]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/FreeRTOS_UDP_IP.c
Add a configASSERT() that checks the gateway address is on the same subnet as the...
[freertos] / FreeRTOS-Plus / Source / FreeRTOS-Plus-UDP / FreeRTOS_UDP_IP.c
index a490e481e91e8dfa98473be69a506de6b09ed3fb..dd12aa748409d90e81f3ce8017fc133e4b4a460c 100644 (file)
@@ -581,6 +581,10 @@ static portBASE_TYPE xReturn = pdFALSE;
                                #else\r
                                {\r
                                        *ipLOCAL_IP_ADDRESS_POINTER = xNetworkAddressing.ulDefaultIPAddress;\r
+                                       \r
+                                       /* Ensure the gateway is on the same subnet as the IP \r
+                                       address. */\r
+                                       configASSERT( ( ( *ipLOCAL_IP_ADDRESS_POINTER ) & xNetworkAddressing.ulNetMask ) == ( xNetworkAddressing.ulGatewayAddress & xNetworkAddressing.ulNetMask ) );\r
                                }\r
                                #endif /* ipconfigUSE_DHCP == 1 */\r
 \r