5555#include "NetworkBufferManagement.h"
5656#include "FreeRTOS_DNS.h"
5757
58+ #if ( ipconfigUSE_TCP_MEM_STATS != 0 )
59+ #include "tcp_mem_stats.h"
60+ #endif
61+
5862/* IPv4 multi-cast addresses range from 224.0.0.0.0 to 240.0.0.0. */
5963#define ipFIRST_MULTI_CAST_IPv4 0xE0000000U /**< Lower bound of the IPv4 multicast address. */
6064#define ipLAST_MULTI_CAST_IPv4 0xF0000000U /**< Higher bound of the IPv4 multicast address. */
@@ -357,6 +361,7 @@ static void prvProcessIPEventsAndTimers( void )
357361 * API will unblock as soon as the eSOCKET_BOUND event is
358362 * triggered. */
359363 pxSocket = ( ( FreeRTOS_Socket_t * ) xReceivedEvent .pvData );
364+ socketASSERT_IS_VALID ( pxSocket );
360365 xAddress .sin_addr = 0U ; /* For the moment. */
361366 xAddress .sin_port = FreeRTOS_ntohs ( pxSocket -> usLocalPort );
362367 pxSocket -> usLocalPort = 0U ;
@@ -375,7 +380,7 @@ static void prvProcessIPEventsAndTimers( void )
375380 * IP-task to actually close a socket. This is handled in
376381 * vSocketClose(). As the socket gets closed, there is no way to
377382 * report back to the API, so the API won't wait for the result */
378- ( void ) vSocketClose ( ( ( FreeRTOS_Socket_t * ) xReceivedEvent .pvData ) );
383+ vSocketClose ( ( ( FreeRTOS_Socket_t * ) xReceivedEvent .pvData ), pdTRUE_UNSIGNED );
379384 break ;
380385
381386 case eStackTxEvent :
@@ -453,6 +458,7 @@ static void prvProcessIPEventsAndTimers( void )
453458 * received a new connection. */
454459 #if ( ipconfigUSE_TCP == 1 )
455460 pxSocket = ( ( FreeRTOS_Socket_t * ) xReceivedEvent .pvData );
461+ socketASSERT_IS_VALID ( pxSocket );
456462
457463 if ( xTCPCheckNewClient ( pxSocket ) != pdFALSE )
458464 {
0 commit comments