Skip to content

Commit 38c73b9

Browse files
committed
Merge branch 'main' of github.com:FreeRTOS/FreeRTOS-Plus-TCP into fix_cleanup_in_release_script
2 parents f241ccd + be2555b commit 38c73b9

File tree

73 files changed

+4165
-2999
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+4165
-2999
lines changed

.github/.cSpellWords.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ DEAS
206206
DEBR
207207
DEBUGEN
208208
DEBUGF
209+
DECASECONDS
209210
DEFFERRALCHECK
210211
DEFR
211212
Deglitchers

source/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ set_property(TARGET freertos_plus_tcp PROPERTY C_STANDARD 90)
55
target_sources( freertos_plus_tcp
66
PRIVATE
77
include/FreeRTOSIPConfigDefaults.h
8+
include/FreeRTOSIPDeprecatedDefinitions.h
89
include/FreeRTOS_ARP.h
910
include/FreeRTOS_BitConfig.h
1011
include/FreeRTOS_DHCP.h
@@ -40,7 +41,6 @@ target_sources( freertos_plus_tcp
4041
include/FreeRTOS_TCP_Utils.h
4142
include/FreeRTOS_TCP_WIN.h
4243
include/FreeRTOS_UDP_IP.h
43-
include/FreeRTOS_errno_TCP.h
4444
include/IPTraceMacroDefaults.h
4545
include/NetworkBufferManagement.h
4646
include/NetworkInterface.h

source/FreeRTOS_IP_Utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1489,7 +1489,7 @@ uint16_t usGenerateChecksum( uint16_t usSum,
14891489

14901490
/**
14911491
* @brief Utility function: Convert error number to a human readable
1492-
* string. Declaration in FreeRTOS_errno_TCP.h.
1492+
* string.
14931493
*
14941494
* @param[in] xErrnum The error number.
14951495
* @param[in] pcBuffer Buffer big enough to be filled with the human readable message.

source/FreeRTOS_Sockets.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -572,10 +572,9 @@ static BaseType_t prvDetermineSocketSize( BaseType_t xDomain,
572572
{
573573
uint16_t usDifference = ipSIZE_OF_IPv6_HEADER - ipSIZE_OF_IPv4_HEADER;
574574

575-
if( pxSocket->u.xTCP.usMSS > usDifference )
576-
{
577-
pxSocket->u.xTCP.usMSS = ( uint16_t ) ( pxSocket->u.xTCP.usMSS - usDifference );
578-
}
575+
/* Because ipconfigTCP_MSS is guaranteed not less than tcpMINIMUM_SEGMENT_LENGTH by FreeRTOSIPConfigDefaults.h,
576+
* it's unnecessary to check if xSocket->u.xTCP.usMSS is greater than difference. */
577+
pxSocket->u.xTCP.usMSS = ( uint16_t ) ( pxSocket->u.xTCP.usMSS - usDifference );
579578
}
580579
#endif /* ipconfigUSE_IPv6 != 0 */
581580

@@ -1259,8 +1258,7 @@ static int32_t prvRecvFrom_CopyPacket( uint8_t * pucEthernetBuffer,
12591258
* (24-bytes) for compatibility.
12601259
*
12611260
* @return The number of bytes received. Or else, an error code is returned. When it
1262-
* returns a negative value, the cause can be looked-up in
1263-
* 'FreeRTOS_errno_TCP.h'.
1261+
* returns a negative value, the cause can be looked-up in 'FreeRTOS-Kernel/projdefs.h'.
12641262
*/
12651263
int32_t FreeRTOS_recvfrom( const ConstSocket_t xSocket,
12661264
void * pvBuffer,
@@ -1570,7 +1568,7 @@ static int32_t prvSendTo_ActualSend( const FreeRTOS_Socket_t * pxSocket,
15701568
* Berkeley sockets standard. Else, it is not used.
15711569
*
15721570
* @return When positive: the total number of bytes sent, when negative an error
1573-
* has occurred: it can be looked-up in 'FreeRTOS_errno_TCP.h'.
1571+
* has occurred: it can be looked-up in 'FreeRTOS-Kernel/projdefs.h'.
15741572
*/
15751573
int32_t FreeRTOS_sendto( Socket_t xSocket,
15761574
const void * pvBuffer,

source/FreeRTOS_TCP_IP.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,11 @@
301301
{
302302
/* A socket was in the connecting phase but something
303303
* went wrong and it should be closed. */
304-
FreeRTOS_debug_printf( ( "Move from %s to %s\n",
305-
FreeRTOS_GetTCPStateName( ( UBaseType_t ) xPreviousState ),
306-
FreeRTOS_GetTCPStateName( eTCPState ) ) );
304+
#if ( ipconfigHAS_DEBUG_PRINTF != 0 )
305+
FreeRTOS_debug_printf( ( "Move from %s to %s\n",
306+
FreeRTOS_GetTCPStateName( ( UBaseType_t ) xPreviousState ),
307+
FreeRTOS_GetTCPStateName( eTCPState ) ) );
308+
#endif
307309

308310
/* Set the flag to show that it was connected before and that the
309311
* status has changed now. This will cause the control flow to go

source/FreeRTOS_TCP_Utils_IPv6.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,10 @@ void prvSocketSetMSS_IPV6( FreeRTOS_Socket_t * pxSocket )
8282
/* Compared to IPv4, an IPv6 header is 20 bytes longer.
8383
* It must be subtracted from the MSS. */
8484
size_t uxDifference = ipSIZE_OF_IPv6_HEADER - ipSIZE_OF_IPv4_HEADER;
85-
/* Do not allow MSS smaller than tcpMINIMUM_SEGMENT_LENGTH. */
86-
#if ( ipconfigTCP_MSS >= tcpMINIMUM_SEGMENT_LENGTH )
87-
{
88-
ulMSS = ipconfigTCP_MSS;
89-
}
90-
#else
91-
{
92-
ulMSS = tcpMINIMUM_SEGMENT_LENGTH;
93-
}
94-
#endif
9585

96-
ulMSS = ( uint32_t ) ( ulMSS - uxDifference );
86+
/* Because ipconfigTCP_MSS is guaranteed not less than tcpMINIMUM_SEGMENT_LENGTH by FreeRTOSIPConfigDefaults.h,
87+
* it's unnecessary to check if xSocket->u.xTCP.usMSS is greater than difference. */
88+
ulMSS = ( uint32_t ) ( ipconfigTCP_MSS - uxDifference );
9789
IPv6_Type_t eType = xIPv6_GetIPType( &( pxSocket->u.xTCP.xRemoteIP.xIP_IPv6 ) );
9890

9991
if( eType == eIPv6_Global )

0 commit comments

Comments
 (0)