Skip to content

Commit d5474ee

Browse files
committed
Merge branch 'main' into dev-ip-build-sep
2 parents 973fbc4 + 8aebab7 commit d5474ee

File tree

82 files changed

+264
-128
lines changed

Some content is hidden

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

82 files changed

+264
-128
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ release.**
1111

1212
## Getting started
1313
The easiest way to use version 4.0.0 and later of FreeRTOS-Plus-TCP is to refer the Getting started Guide (found [here](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/GettingStarted.md))
14-
Another way is to start with the pre-configured IPv4 Windows Simulator demo (found in [this directory](https://github.com/FreeRTOS/FreeRTOS/tree/main/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_Minimal_Windows_Simulator)) or IPv6 Multi-endpoint Windows Simulator demo (found in [this directory](https://github.com/FreeRTOS/FreeRTOS/tree/main/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_IPv6_Demo/IPv6_Multi_WinSim_demo)). That way you will have the correct FreeRTOS source files included, and the correct include paths configured. Once a demo application is building and executing you can remove the demo application files, and start to add in your own application source files. See the [FreeRTOS Kernel Quick Start Guide](https://www.freertos.org/FreeRTOS-quick-start-guide.html) for detailed instructions and other useful links.
14+
Another way is to start with the pre-configured IPv4 Windows Simulator demo (found in [this directory](https://github.com/FreeRTOS/FreeRTOS/tree/main/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_Minimal_Windows_Simulator)) or IPv6 Multi-endpoint Windows Simulator demo (found in [this directory](https://github.com/FreeRTOS/FreeRTOS/tree/main/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_IPv6_Demo/IPv6_Multi_WinSim_demo)). That way you will have the correct FreeRTOS source files included, and the correct include paths configured. Once a demo application is building and executing you can remove the demo application files, and start to add in your own application source files. See the [FreeRTOS Kernel Quick Start Guide](https://www.freertos.org/Documentation/01-FreeRTOS-quick-start/01-Beginners-guide/02-Quick-start-guide) for detailed instructions and other useful links.
1515

16-
Additionally, for FreeRTOS-Plus-TCP source code organization refer to the [Documentation](http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_Networking_Tutorial.html), and [API Reference](https://freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/FreeRTOS_TCP_API_Functions.html).
16+
Additionally, for FreeRTOS-Plus-TCP source code organization refer to the [Documentation](http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_Networking_Tutorial.html), and [API Reference](https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/01-FreeRTOS-plus-TCP-APIs).
1717

1818
### Getting help
19-
If you have any questions or need assistance troubleshooting your FreeRTOS project, we have an active community that can help on the [FreeRTOS Community Support Forum](https://forums.freertos.org). Please also refer to [FAQ](http://www.freertos.org/FAQHelp.html) for frequently asked questions.
19+
If you have any questions or need assistance troubleshooting your FreeRTOS project, we have an active community that can help on the [FreeRTOS Community Support Forum](https://forums.freertos.org). Please also refer to [FAQ](https://www.freertos.org/Why-FreeRTOS/FAQs) for frequently asked questions.
2020

2121
Also see the [Submitting a bugs/feature request](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/.github/CONTRIBUTING.md#submitting-a-bugsfeature-request) section of CONTRIBUTING.md for more details.
2222

@@ -91,7 +91,7 @@ git submodule update --checkout --init --recursive tools/CMock test/FreeRTOS-Ker
9191
```
9292

9393
## Porting
94-
The porting guide is available on [this page](http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/FreeRTOS_TCP_Porting.html).
94+
The porting guide is available on [this page](https://www.freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/01-FreeRTOS_TCP_Porting).
9595

9696
## Repository structure
9797
This repository contains the FreeRTOS-Plus-TCP repository and a number of supplementary libraries for testing/PR Checks.

readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ A description of the source code organisation is available on:
77
http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_Networking_Tutorial.html
88

99
The porting guide is available on:
10-
http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/FreeRTOS_TCP_Porting.html
10+
https://www.freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/01-FreeRTOS_TCP_Porting
1111

1212
License information is available on:
1313
http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/FreeRTOS_Plus_TCP_License.html

source/FreeRTOS_ARP.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@
881881
MACAddress_t * const pxMACAddress,
882882
struct xNetworkEndPoint ** ppxEndPoint )
883883
{
884-
eResolutionLookupResult_t eReturn;
884+
eResolutionLookupResult_t eReturn = eResolutionFailed;
885885
uint32_t ulAddressToLookup;
886886
NetworkEndPoint_t * pxEndPoint = NULL;
887887

@@ -893,7 +893,17 @@
893893
ulAddressToLookup = *pulIPAddress;
894894
pxEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( ulAddressToLookup );
895895

896-
if( xIsIPv4Multicast( ulAddressToLookup ) != 0 )
896+
if( xIsIPv4Loopback( ulAddressToLookup ) != 0 )
897+
{
898+
if( pxEndPoint != NULL )
899+
{
900+
/* For multi-cast, use the first IPv4 end-point. */
901+
memcpy( pxMACAddress->ucBytes, pxEndPoint->xMACAddress.ucBytes, sizeof( pxMACAddress->ucBytes ) );
902+
*( ppxEndPoint ) = pxEndPoint;
903+
eReturn = eResolutionCacheHit;
904+
}
905+
}
906+
else if( xIsIPv4Multicast( ulAddressToLookup ) != 0 )
897907
{
898908
/* Get the lowest 23 bits of the IP-address. */
899909
vSetMultiCastIPv4MacAddress( ulAddressToLookup, pxMACAddress );

source/FreeRTOS_DNS_Callback.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@
7676
BaseType_t xMatching;
7777
DNSCallback_t * pxCallback = ( ( DNSCallback_t * ) listGET_LIST_ITEM_OWNER( pxIterator ) );
7878
#if ( ipconfigUSE_MDNS == 1 )
79-
/* mDNS port 5353. */
80-
if( pxSet->usPortNumber == FreeRTOS_htons( ipMDNS_PORT ) )
79+
/* mDNS port 5353. Host byte order comparison. */
80+
if( pxSet->usPortNumber == ipMDNS_PORT )
8181
{
8282
/* In mDNS, the query ID field is ignored and the
8383
* hostname will be compared with outstanding requests. */

source/FreeRTOS_IP.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,12 +1553,13 @@ eFrameProcessingResult_t eConsiderFrameForProcessing( const uint8_t * const pucE
15531553
else
15541554
{
15551555
/* The frame is an unsupported Ethernet II type */
1556-
#if ipconfigIS_DISABLED( ipconfigPROCESS_CUSTOM_ETHERNET_FRAMES )
1557-
/* Processing custom ethernet frames is disabled - release it. */
1558-
break;
1559-
#else
1560-
/* Processing custom ethernet frames is enabled - Continue filter checks. */
1556+
#if ipconfigIS_ENABLED( ipconfigPROCESS_CUSTOM_ETHERNET_FRAMES )
1557+
1558+
/* Processing custom Ethernet frames is enabled. No need for any further testing.
1559+
* Accept the frame whether it's a unicast, multicast, or broadcast. */
1560+
eReturn = eProcessBuffer;
15611561
#endif
1562+
break;
15621563
}
15631564

15641565
/* Third, filter based on destination mac address. */

source/FreeRTOS_Sockets.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2356,17 +2356,25 @@ void * vSocketClose( FreeRTOS_Socket_t * pxSocket )
23562356
uint32_t ulNewValue;
23572357
BaseType_t xReturn;
23582358

2359+
if( ( FreeRTOS_issocketconnected( pxSocket ) == pdTRUE ) )
2360+
{
2361+
/* If this socket is the child of a listening socket, the remote client may or may not have already sent
2362+
* us data. If data was already sent, then pxSocket->u.xTCP.rxStream != NULL and this call will fail.
2363+
* Warn the user about this inconsistent behavior. */
2364+
FreeRTOS_printf( ( "Warning: Changing buffer/window properties on a connected socket may fail." ) );
2365+
}
2366+
23592367
if( pxSocket->ucProtocol != ( uint8_t ) FREERTOS_IPPROTO_TCP )
23602368
{
2361-
FreeRTOS_debug_printf( ( "Set SO_%sBUF: wrong socket type\n",
2362-
( lOptionName == FREERTOS_SO_SNDBUF ) ? "SND" : "RCV" ) );
2369+
FreeRTOS_printf( ( "Set SO_%sBUF: wrong socket type\n",
2370+
( lOptionName == FREERTOS_SO_SNDBUF ) ? "SND" : "RCV" ) );
23632371
xReturn = -pdFREERTOS_ERRNO_EINVAL;
23642372
}
23652373
else if( ( ( lOptionName == FREERTOS_SO_SNDBUF ) && ( pxSocket->u.xTCP.txStream != NULL ) ) ||
23662374
( ( lOptionName == FREERTOS_SO_RCVBUF ) && ( pxSocket->u.xTCP.rxStream != NULL ) ) )
23672375
{
2368-
FreeRTOS_debug_printf( ( "Set SO_%sBUF: buffer already created\n",
2369-
( lOptionName == FREERTOS_SO_SNDBUF ) ? "SND" : "RCV" ) );
2376+
FreeRTOS_printf( ( "Set SO_%sBUF: buffer already created\n",
2377+
( lOptionName == FREERTOS_SO_SNDBUF ) ? "SND" : "RCV" ) );
23702378
xReturn = -pdFREERTOS_ERRNO_EINVAL;
23712379
}
23722380
else

source/FreeRTOS_Stream_Buffer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ size_t uxStreamBufferAdd( StreamBuffer_t * const pxBuffer,
307307

308308
/* The below update to the stream buffer members must happen
309309
* atomically. */
310-
vTaskSuspendAll();
310+
taskENTER_CRITICAL();
311311
{
312312
if( uxOffset == 0U )
313313
{
@@ -328,7 +328,7 @@ size_t uxStreamBufferAdd( StreamBuffer_t * const pxBuffer,
328328
pxBuffer->uxFront = uxNextHead;
329329
}
330330
}
331-
( void ) xTaskResumeAll();
331+
taskEXIT_CRITICAL();
332332
}
333333

334334
return uxCount;

source/include/FreeRTOS_IP.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ uint32_t FreeRTOS_round_down( uint32_t a,
307307
/*
308308
* FULL, UP-TO-DATE AND MAINTAINED REFERENCE DOCUMENTATION FOR ALL THESE
309309
* FUNCTIONS IS AVAILABLE ON THE FOLLOWING URL:
310-
* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/FreeRTOS_TCP_API_Functions.html
310+
* https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/01-FreeRTOS-plus-TCP-APIs
311311
*/
312312

313313
/* FreeRTOS_IPInit_Multi() replaces the earlier FreeRTOS_IPInit(). It assumes

source/include/FreeRTOS_Sockets.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@
199199
/**
200200
* FULL, UP-TO-DATE AND MAINTAINED REFERENCE DOCUMENTATION FOR ALL THESE
201201
* FUNCTIONS IS AVAILABLE ON THE FOLLOWING URL:
202-
* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/FreeRTOS_TCP_API_Functions.html
202+
* https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/01-FreeRTOS-plus-TCP-APIs
203203
*/
204204

205205
/* Common Socket Attributes. */

source/include/IPTraceMacroDefaults.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* @file IPTraceMacroDefaults.h
3030
* @brief This file provides default (empty) implementations for any IP trace
3131
* macros that are not defined by the user. See
32-
* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_IP_Trace.html
32+
* https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/08-Trace-macros
3333
*/
3434

3535
#ifndef IP_TRACE_MACRO_DEFAULTS_H

0 commit comments

Comments
 (0)