Skip to content

Commit

Permalink
Merge branch 'main' into dev-ip-build-sep
Browse files Browse the repository at this point in the history
  • Loading branch information
HTRamsey committed Aug 1, 2024
2 parents 9d5ec49 + 782a7e5 commit c43498d
Show file tree
Hide file tree
Showing 221 changed files with 4,932 additions and 2,006 deletions.
1 change: 1 addition & 0 deletions .github/.cSpellWords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ FPSP
FRAMERX
FRMFILTER
frms
fsanitize
FSDMA
FTSR
FUDUP
Expand Down
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ When creating a new topic on the forums or filing an issue, please include as ma
## Contributing via pull request
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:

1. You are working against the latest source on the *master* branch.
1. You are working against the latest source on the *main* branch.
2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
3. You open an issue to discuss any significant work - we would hate for your time to be wasted.

Expand Down Expand Up @@ -63,7 +63,7 @@ Looking at the existing issues is a great way to find something to contribute on


## Licensing
The FreeRTOS-Plus-TCP library is released under the MIT open source license, the text of which can be found [here](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/master/LICENSE.md)
The FreeRTOS-Plus-TCP library is released under the MIT open source license, the text of which can be found [here](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/LICENSE.md)

Additional license files can be found in the folders containing any supplementary libraries licensed by their respective copyright owners where applicable.

Expand Down
57 changes: 43 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,56 @@ jobs:
echo "::endgroup::"
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
# Separate builds for sanitizers and coverage:
# These can currently not be combined without branch coverage dilution.
- env:
stepName: Build Unit Tests
stepName: Build Unit Tests (aubsan build)
name: ${{ env.stepName }}
run: |
# ${{ env.stepName }}
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
cmake -S test/unit-test -B test/unit-test/build/ -G Ninja
cmake --build test/unit-test/build/ --target all
cmake --fresh -G Ninja -S test/unit-test -B test/unit-test/build/ -DSANITIZE=address,undefined
ninja -C test/unit-test/build/
echo "::endgroup::"
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
- env:
stepName: Run Unit Tests
stepName: Run Unit Tests (aubsan build)
name: ${{ env.stepName }}
shell: bash
run: |
# ${{ env.stepName }}
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
env ASAN_OPTIONS=detect_odr_violation=0 ctest --test-dir test/unit-test/build/ -E system --output-on-failure
echo "::endgroup::"
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
- env:
stepName: Build Unit Tests (coverage build)
name: ${{ env.stepName }}
run: |
# ${{ env.stepName }}
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
cmake --fresh -G Ninja -S test/unit-test -B test/unit-test/build/ -DSANITIZE=
ninja -C test/unit-test/build/
echo "::endgroup::"
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
- env:
stepName: Run Unit Tests (coverage build)
name: ${{ env.stepName }}
shell: bash
run: |
# ${{ env.stepName }}
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
find test/unit-test/build/ -name '*.gcda' -delete
ctest --test-dir test/unit-test/build/ -E system --output-on-failure
echo "::endgroup::"
Expand Down Expand Up @@ -170,7 +199,7 @@ jobs:
# ${{ env.stepName }}
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL
cmake -S . -B build -DFREERTOS_PLUS_TCP_ENABLE_BUILD_CHECKS=ON -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL
cmake --build build --target freertos_plus_tcp_build_test
echo "::endgroup::"
Expand All @@ -183,7 +212,7 @@ jobs:
# ${{ env.stepName }}
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL_IPV4
cmake -S . -B build -DFREERTOS_PLUS_TCP_ENABLE_BUILD_CHECKS=ON -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL_IPV4
cmake --build build --target clean
cmake --build build --target freertos_plus_tcp_build_test
Expand All @@ -197,7 +226,7 @@ jobs:
# ${{ env.stepName }}
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL_IPV6
cmake -S . -B build -DFREERTOS_PLUS_TCP_ENABLE_BUILD_CHECKS=ON -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL_IPV6
cmake --build build --target freertos_plus_tcp_build_test
echo "::endgroup::"
Expand All @@ -210,7 +239,7 @@ jobs:
# ${{ env.stepName }}
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL_IPV4_IPV6
cmake -S . -B build -DFREERTOS_PLUS_TCP_ENABLE_BUILD_CHECKS=ON -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL_IPV4_IPV6
cmake --build build --target clean
cmake --build build --target freertos_plus_tcp_build_test
Expand All @@ -224,7 +253,7 @@ jobs:
# ${{ env.stepName }}
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL_IPV4_TCP
cmake -S . -B build -DFREERTOS_PLUS_TCP_ENABLE_BUILD_CHECKS=ON -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL_IPV4_TCP
cmake --build build --target clean
cmake --build build --target freertos_plus_tcp_build_test
Expand All @@ -238,7 +267,7 @@ jobs:
# ${{ env.stepName }}
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL_IPV6_TCP
cmake -S . -B build -DFREERTOS_PLUS_TCP_ENABLE_BUILD_CHECKS=ON -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL_IPV6_TCP
cmake --build build --target freertos_plus_tcp_build_test
echo "::endgroup::"
Expand All @@ -251,7 +280,7 @@ jobs:
# ${{ env.stepName }}
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=DISABLE_ALL
cmake -S . -B build -DFREERTOS_PLUS_TCP_ENABLE_BUILD_CHECKS=ON -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=DISABLE_ALL
cmake --build build --target clean
cmake --build build --target freertos_plus_tcp_build_test
Expand All @@ -265,7 +294,7 @@ jobs:
# ${{ env.stepName }}
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=DEFAULT_CONF
cmake -S . -B build -DFREERTOS_PLUS_TCP_ENABLE_BUILD_CHECKS=ON -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=DEFAULT_CONF
cmake --build build --target clean
cmake --build build --target freertos_plus_tcp_build_test
Expand All @@ -276,7 +305,7 @@ jobs:
stepName: Build checks (Header Self Contain)
shell: bash
run: |
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=HEADER_SELF_CONTAIN
cmake -S . -B build -DFREERTOS_PLUS_TCP_ENABLE_BUILD_CHECKS=ON -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=HEADER_SELF_CONTAIN
cmake --build build --target clean
cmake --build build --target freertos_plus_tcp_build_test_FreeRTOS_DHCP
cmake --build build --target freertos_plus_tcp_build_test_FreeRTOS_DNS
Expand Down Expand Up @@ -377,7 +406,7 @@ jobs:
- name: Set up CBMC runner
uses: FreeRTOS/CI-CD-Github-Actions/set_up_cbmc_runner@main
with:
cbmc_version: "5.61.0"
cbmc_version: "5.95.1"

- env:
stepName: Install Dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.commit_id }}
ref: ${{ github.event.inputs.version_number }}
path: FreeRTOS-Plus-TCP
submodules: recursive
- name: Checkout disabled submodules
Expand Down
33 changes: 5 additions & 28 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

cmake_minimum_required(VERSION 3.15)
cmake_minimum_required(VERSION 3.21)
cmake_policy(SET CMP0048 NEW) # project version
cmake_policy(SET CMP0076 NEW) # full paths

Expand All @@ -20,6 +20,7 @@ endif()

# Options
option(FREERTOS_PLUS_TCP_BUILD_TEST "Build the test for FreeRTOS Plus TCP" OFF)
option(FREERTOS_PLUS_TCP_ENABLE_BUILD_CHECKS "Enable the build checks for FreeRTOS-Plus-TCP" OFF)

# Configuration
# Override these at project level with:
Expand Down Expand Up @@ -149,32 +150,6 @@ endif()
# There is also the need to add a target - typically an interface library that describes the
# Configuration for FreeRTOS-Kernel and FreeRTOS-Plus-TCP.
# This is called freertos_config
# If not defined will be default compile with one of the test build combinations AllEnable.

# Select the appropriate Build Test configuration
# This is only used when freertos_config is not defined, otherwise the build test will be performed
# on the config defined in the freertos_config
set(FREERTOS_PLUS_TCP_TEST_CONFIGURATION "CUSTOM" CACHE STRING "FreeRTOS Plus TCP Build Test configuration")
set(FREERTOS_PLUS_TCP_TEST_CONFIGURATION_LIST
CUSTOM # Custom (external) configuration -eg from a top-level project
ENABLE_ALL # Enable all configuration settings
ENABLE_ALL_IPV4 # Enable all configuration settings IPv4 UDP
ENABLE_ALL_IPV6 # Enable all configuration settings IPv6 UDP
ENABLE_ALL_IPV4_TCP # Enable all configuration settings IPv4 TCP
ENABLE_ALL_IPV6_TCP # Enable all configuration settings IPv6 TCP
ENABLE_ALL_IPV4_IPV6 # Enable all configuration settings IPv4 IPv6 UDP
DISABLE_ALL # Disable all configuration settings
HEADER_SELF_CONTAIN # Enable header self contain test
DEFAULT_CONF # Default (typical) configuration
)
if(NOT FREERTOS_PLUS_TCP_TEST_CONFIGURATION IN_LIST FREERTOS_PLUS_TCP_TEST_CONFIGURATION_LIST)
message(FATAL_ERROR "Invalid FREERTOS_PLUS_TCP_TEST_CONFIGURATION value '${FREERTOS_PLUS_TCP_TEST_CONFIGURATION}' should be one of: ${FREERTOS_PLUS_TCP_TEST_CONFIGURATION_LIST}")
else()
message(STATUS "Using FreeRTOS-Plus-TCP Test Configuration : ${FREERTOS_PLUS_TCP_TEST_CONFIGURATION}")
if (NOT FREERTOS_PLUS_TCP_TEST_CONFIGURATION STREQUAL "CUSTOM")
message(WARNING "FreeRTOS-Kernel configuration settings are configured by FreeRTOS-Plus-TCP")
endif()
endif()

########################################################################
# External Dependencies
Expand All @@ -199,4 +174,6 @@ add_subdirectory(source)
add_subdirectory(tools)
add_subdirectory(test)

FetchContent_MakeAvailable(freertos_kernel cmock)
if(PROJECT_IS_TOP_LEVEL)
FetchContent_MakeAvailable(freertos_kernel cmock)
endif()
69 changes: 69 additions & 0 deletions History.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,74 @@
Documentation and download available at https://www.FreeRTOS.org/

Changes between FreeRTOS-plus-TCP V4.2.0 and V4.1.0 released June 24, 2024
+ It was possible for a carefully crafted DNS response with domain name
length value greater than the actual domain name length, to cause a buffer
over-read within the DNS Response Parser. This issue affects applications
using DNS functionality of the FreeRTOS-Plus-TCP stack.
Applications that do not use DNS functionality are not affected,
even when the DNS functionality is enabled.
This issue has been fixed by modifying the code to ensure that the DNS
Response Parser never attempts to read beyond the DNS
response buffer boundary.
We would like to thank Paschal Amusuo, James C. Davis, and
Aravind Machiry of Purdue University, for reporting this issue.
+ Fixed possible freed memory being reused while creating TCP sockets.
We thank @htibosch for their contribution.
+ Fixed possible NULL pointer dereference in TCP transmission.
We thank @anordal for their contribution.
+ Added network interface port for ARM Corstone-315 (MPS4_CS315).
We thank @david-hazi-arm for their contribution.
+ Fixed MISRA C 2012 issues in the code
+ Replaced the usage strcpy with strncpy
+ Improved memory allocation failure handling in `vDNSSetCallBack` by
propagating error signal back. We thank @hlef for reporting this issue.
+ Improved memory allocation failure handling in `prvCreateSectors` by
propagating error signal back. We thank @hlef for reporting this issue.
+ Enabled build on CI with sanitizers, fixed all AddressSanitizer
and UB-Sanitizer errors. We thank @anordal for their contribution.
+ Fixed mDNS lookups while parsing the mDNS answers.
We thank @htibosch for their contribution.
+ Fixed DNS name resolution responses when the device IP address
is `0.0.0.0`. We thank @evpopov for their contribution.
+ Avoided FreeRTOS-Plus-TCP forcing to use the compilation options
set in the library CMake project in user projects.
We thank @apcountryman for their contribution.
+ Enabled user control of compiler analysis for non ISO statements.
We thank @thirtytwobits for their contribution
+ Fixed use of removed macro in ATSAME5x network interface.
We thank @apcountryman for their contribution.
+ Fixed inconsistent use of `ipconfigCOMPATIBLE_WITH_SINGLE`
& `ipconfigIPv4_BACKWARD_COMPATIBLE`
+ Resolved Unit Test Build Warnings
+ Added network interface functions for multicast MAC address filtering.
We thank @evpopov for their contribution.
+ Fixed missing `ipconfigUSE_DNS_CACHE` check in FreeRTOS_DNS.c.
+ Avoided compiler warnings about the printf formats in IPv6 modules.
We thank @htibosch for their contribution.
+ Removed deprecated macro `ipconfigMULTI_INTERFACE`.
We thank @HTRamsey for their contribution.
+ Removed unused function xProcessedTCPMessage.
We thank @HTRamsey for their contribution.
+ Removed deprecated macros ipLOCAL_MAC_ADDRESS and
`ipLOCAL_IP_ADDRESS_POINTER`. We thank @HTRamsey for their contribution.
+ Fixed eARPGetCacheEntryGateWay to properly report when no valid gateway is found
for a packet that needs to be sent outside the local network.
We thank @evpopov for their contribution.
+ Combined duplicated IPv4/IPv6 TCP code.
We thank @HTRamsey for their contribution.
+ Improved validation of configuration macros in the default
IP config using static compile time checks.
We thank @HTRamsey for their contribution.
+ Repaired ARP unit tests which were accessing packet memory
outside of allocated bounds.
+ Moved CMake compile options to test builds to avoid build issues in
user projects that might be not be supporting compiler options used
in the original Cmake. We thank @apcountryman for their contribution.
+ Cleaned up CMake by adding: additional unit tests, incorporating missing
network interface support, removing unused "config files" that are no longer
required, and fixing file name issues in the unit testing framework.
We thank @HTRamsey for their contribution.

Changes between FreeRTOS-plus-TCP V4.1.0 and V4.0.0 released March 8, 2024
+ Add new Network Interface for Corstone-300 FVP (MPS3_AN552).
We thank @urutva for their contribution.
Expand Down
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ FreeRTOS-Plus-TCP is a lightweight TCP/IP stack for FreeRTOS. It provides a fami

This library has undergone static code analysis and checks for compliance with the [MISRA coding standard](https://www.misra.org.uk/). Any deviations from the MISRA C:2012 guidelines are documented under [MISRA Deviations](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/MISRA.md). The library is validated for memory safety and data structure invariance through the [CBMC automated reasoning tool](https://www.cprover.org/cbmc/) for the functions that parse data originating from the network. The library is also protocol tested using Maxwell protocol tester for both IPv4 and IPv6.

**FreeRTOS-Plus-TCP Library V4.2.2
[source code](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/tree/V4.2.2/source)
is part of the
[FreeRTOS 202406.01 LTS](https://github.com/FreeRTOS/FreeRTOS-LTS/tree/202406.01-LTS)
release.**

## Getting started
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))
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.
Expand Down Expand Up @@ -45,7 +51,7 @@ Add the following into your project's main or a subdirectory's `CMakeLists.txt`:
```cmake
FetchContent_Declare( freertos_plus_tcp
GIT_REPOSITORY https://github.com/FreeRTOS/FreeRTOS-Plus-TCP.git
GIT_TAG master #Note: Best practice to use specific git-hash or tagged version
GIT_TAG main #Note: Best practice to use specific git-hash or tagged version
GIT_SUBMODULES "" # Don't grab any submodules since not latest
)
```
Expand All @@ -54,13 +60,12 @@ FetchContent_Declare( freertos_plus_tcp
- this particular example supports a native and cross-compiled build option.

```cmake
set( FREERTOS_PLUS_FAT_DEV_SUPPORT OFF CACHE BOOL "" FORCE)
# Select the native compile PORT
set( FREERTOS_PLUS_FAT_PORT "POSIX" CACHE STRING "" FORCE)
# Select the cross-compile PORT
set( FREERTOS_PLUS_TCP_NETWORK_IF "POSIX" CACHE STRING "" FORCE)
# Or: select a cross-compile PORT
if (CMAKE_CROSSCOMPILING)
# Eg. Zynq 2019_3 version of port
set(FREERTOS_PLUS_FAT_PORT "ZYNQ_2019_3" CACHE STRING "" FORCE)
# Eg. STM32Hxx version of port
set(FREERTOS_PLUS_TCP_NETWORK_IF "STM32HXX" CACHE STRING "" FORCE)
endif()
FetchContent_MakeAvailable(freertos_plus_tcp)
Expand Down
2 changes: 1 addition & 1 deletion docs/doxygen/config.doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ PROJECT_NAME = FreeRTOS-Plus-TCP
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = V4.1.0
PROJECT_NUMBER = V4.2.0

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
4 changes: 2 additions & 2 deletions manifest.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: "FreeRTOS-Plus-TCP"
version: "V4.1.0"
version: "V4.2.0"
description:
"Thread safe FreeRTOS TCP/IP stack working on top of the FreeRTOS-Kernel to
implement the TCP/IP protocol. Suitable for microcontrollers."
license: "MIT"
dependencies:
- name: "FreeRTOS-Kernel"
version: "V11.0.1"
version: "V11.1.0"
license: "MIT"
repository:
type: "git"
Expand Down
Loading

0 comments on commit c43498d

Please sign in to comment.