From 1354f976ebaa473f27de8ec66eaa9f9080a4afb2 Mon Sep 17 00:00:00 2001 From: richardbarry Date: Wed, 23 Oct 2013 13:59:51 +0000 Subject: [PATCH] Second attempt - Ensure the private port number wrap check is inside the critical section in prvGetPrivatePortNumber() (UDP). git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2075 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/FreeRTOS_Sockets.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/FreeRTOS_Sockets.c b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/FreeRTOS_Sockets.c index 5c9ff73de..ffd1a812e 100644 --- a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/FreeRTOS_Sockets.c +++ b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/FreeRTOS_Sockets.c @@ -943,11 +943,11 @@ uint16_t usReturn; create first so the early port numbers may still be in use. */ usNextPortToUse = socketAUTO_PORT_ALLOCATION_RESET_NUMBER; } + + usReturn = FreeRTOS_htons( usNextPortToUse ); } taskEXIT_CRITICAL(); - usReturn = FreeRTOS_htons( usNextPortToUse ); - return usReturn; } /* Tested */ /*-----------------------------------------------------------*/ -- 2.39.5