]> git.sur5r.net Git - freertos/commitdiff
Add a configASSERT() that checks the gateway address is on the same subnet as the...
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Mon, 14 Oct 2013 14:35:53 +0000 (14:35 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Mon, 14 Oct 2013 14:35:53 +0000 (14:35 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2064 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

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