Fix a Bug and corresponding CBMC patch (#84)

* Update remove-static-in-freertos-tcp-ip.patch

* Update FreeRTOS_TCP_IP.c

* Update remove-static-in-freertos-tcp-ip.patch

* Update remove-static-in-freertos-tcp-ip.patch

Co-authored-by: Yuhui Zheng <10982575+yuhui-zheng@users.noreply.github.com>
This commit is contained in:
Aniruddha Kanhere
2020-06-03 16:52:31 -07:00
committed by GitHub
parent bb9f92f771
commit f11bcc8acc
3 changed files with 98 additions and 105 deletions

View File

@ -1,6 +1,5 @@
From afc01793c4531cfbe9f92e7ca2ce9364983d987e Mon Sep 17 00:00:00 2001
From: Mark R Tuttle <mrtuttle@amazon.com>
Date: Tue, 12 May 2020 15:57:56 +0000
From: Aniruddha R Kanhere <kanherea@amazon.com>
Date: Wed, 03 June 2020 09:51:25 +0000
Subject: [PATCH] modified lib
---
@ -8,7 +7,7 @@ Subject: [PATCH] modified lib
1 file changed, 24 insertions(+)
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/FreeRTOS_TCP_IP.c b/FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/FreeRTOS_TCP_IP.c
index dc58621..963b576 100644
index 7a2c00c68..cb537b347 100644
--- a/FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/FreeRTOS_TCP_IP.c
+++ b/FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/FreeRTOS_TCP_IP.c
@@ -198,14 +198,22 @@ static BaseType_t prvTCPPrepareConnect( FreeRTOS_Socket_t *pxSocket );
@ -34,18 +33,18 @@ index dc58621..963b576 100644
size_t uxTotalLength,
FreeRTOS_Socket_t * const pxSocket,
BaseType_t xHasSYNFlag );
@@ -214,7 +222,11 @@ static size_t prvSingleStepTCPHeaderOptions( const uint8_t * const pucPtr,
* Skip past TCP header options when doing Selective ACK, until there are no
* more options left.
*/
+#ifdef CBMC
+void prvReadSackOption( const uint8_t * const pucPtr,
+#else
static void prvReadSackOption( const uint8_t * const pucPtr,
+#endif
size_t uxIndex,
FreeRTOS_Socket_t * const pxSocket );
@@ -215,7 +223,11 @@ static size_t prvSingleStepTCPHeaderOptions( const uint8_t * const pucPtr,
* Skip past TCP header options when doing Selective ACK, until there are no
* more options left.
*/
+ #ifdef CBMC
+ void prvReadSackOption( const uint8_t * const pucPtr,
+ #else
static void prvReadSackOption( const uint8_t * const pucPtr,
+ #endif
size_t uxIndex,
FreeRTOS_Socket_t * const pxSocket );
#endif/* ( ipconfigUSE_TCP_WIN == 1 ) */
@@ -1137,7 +1149,11 @@ uint32_t ulInitialSequenceNumber = 0;
* that: ((pxTCPHeader->ucTCPOffset & 0xf0) > 0x50), meaning that the TP header
* is longer than the usual 20 (5 x 4) bytes.
@ -58,7 +57,7 @@ index dc58621..963b576 100644
{
size_t uxTCPHeaderOffset = ipSIZE_OF_ETH_HEADER + xIPHeaderSize( pxNetworkBuffer );
const ProtocolHeaders_t *pxProtocolHeaders = ipPOINTER_CAST( ProtocolHeaders_t *,
@@ -1201,7 +1217,11 @@ uint8_t ucLength;
@@ -1199,7 +1215,11 @@ uint8_t ucLength;
}
/*-----------------------------------------------------------*/
@ -70,18 +69,15 @@ index dc58621..963b576 100644
size_t uxTotalLength,
FreeRTOS_Socket_t * const pxSocket,
BaseType_t xHasSYNFlag )
@@ -1346,7 +1366,11 @@ TCPWindow_t *pxTCPWindow = &( pxSocket->u.xTCP.xTCPWindow );
}
@@ -1331,7 +1351,11 @@ TCPWindow_t *pxTCPWindow = &( pxSocket->u.xTCP.xTCPWindow );
/*-----------------------------------------------------------*/
+#ifdef CBMC
+void prvReadSackOption( const uint8_t * const pucPtr,
+#else
static void prvReadSackOption( const uint8_t * const pucPtr,
+#endif
size_t uxIndex,
FreeRTOS_Socket_t * const pxSocket )
{
--
2.7.4
#if( ipconfigUSE_TCP_WIN == 1 )
+ #ifdef CBMC
+ void prvReadSackOption( const uint8_t * const pucPtr,
+ #else
static void prvReadSackOption( const uint8_t * const pucPtr,
+ #endif
size_t uxIndex,
FreeRTOS_Socket_t * const pxSocket )
{