From de8b25794965ba3d1c5c58320b6899761d96e932 Mon Sep 17 00:00:00 2001 From: tony-josi-aws Date: Mon, 20 Mar 2023 08:58:34 +0530 Subject: [PATCH 1/5] Fix test 1 and 2 of the IPv6 destination opts protocol tests --- source/FreeRTOS_IPv6.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/source/FreeRTOS_IPv6.c b/source/FreeRTOS_IPv6.c index 4ea2dc607d..010eea9705 100644 --- a/source/FreeRTOS_IPv6.c +++ b/source/FreeRTOS_IPv6.c @@ -342,6 +342,7 @@ eFrameProcessingResult_t eHandleIPv6ExtensionHeaders( NetworkBufferDescriptor_t uint8_t ucCurrentHeader = pxIPPacket_IPv6->xIPHeader.ucNextHeader; uint8_t ucNextHeader = 0U; BaseType_t xNextOrder = 0; + BaseType_t xExtHeaderCount = 0; while( ( uxIndex + 8U ) < uxMaxLength ) { @@ -379,9 +380,18 @@ eFrameProcessingResult_t eHandleIPv6ExtensionHeaders( NetworkBufferDescriptor_t ucNextHeader, ( int ) xNextOrder ) ); - if( xNextOrder <= xCurrentOrder ) + xExtHeaderCount += 1; + + /* + * IPv6 nodes must accept and attempt to process extension headers in + * any order and occurring any number of times in the same packet, + * except for the Hop-by-Hop Options header which is restricted to + * appear immediately after an IPv6 header only. Outlined + * by RFC 2460 section 4.1 Extension Header Order. + */ + if ( xExtHeaderCount > 1 && xCurrentOrder == 1 ) /* ipIPv6_EXT_HEADER_HOP_BY_HOP */ { - FreeRTOS_printf( ( "Wrong order\n" ) ); + FreeRTOS_printf( ( "Wrong order. Hop-by-Hop Options header restricted to appear immediately after an IPv6 header\n" ) ); uxIndex = uxMaxLength; break; } From 50bdfda6f7520fe427fa074eefdcdf8423ff7bf5 Mon Sep 17 00:00:00 2001 From: tony-josi-aws Date: Tue, 28 Mar 2023 14:11:05 +0530 Subject: [PATCH 2/5] fixing spelling --- .github/lexicon.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/lexicon.txt b/.github/lexicon.txt index 828fac66de..605fa84a5b 100644 --- a/.github/lexicon.txt +++ b/.github/lexicon.txt @@ -1722,6 +1722,7 @@ xcolon xconnected xcount xcurlength +xcurrentorder xcurstart xdatalength xdatalengthbytes @@ -1765,6 +1766,7 @@ xeventgroupwaitbits xexpected xexpectedmessagetype xexpiredstate +xextheadercount xfamily xfield xflags From 44b5793c011b0f44b0bdc7bfba0a773e4cb42e3e Mon Sep 17 00:00:00 2001 From: Tony Josi Date: Thu, 30 Mar 2023 04:08:45 +0000 Subject: [PATCH 3/5] uncrustify yml fix (#815) --- .github/workflows/ci.yml | 7 ++++--- .github/workflows/uncrustify.yml | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6e9808391..75928828c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,11 +71,12 @@ jobs: formatting: # Use only 18.04 since we want the uncrustify version to # be 0.66.1_f to ensure proper formatting. - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 + container: ubuntu:18.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install Uncrustify - run: sudo apt-get install uncrustify + run: apt-get update && apt-get install uncrustify - name: Run Uncrustify run: | uncrustify --version diff --git a/.github/workflows/uncrustify.yml b/.github/workflows/uncrustify.yml index 01bf905be4..2e492b8ba6 100644 --- a/.github/workflows/uncrustify.yml +++ b/.github/workflows/uncrustify.yml @@ -8,7 +8,8 @@ jobs: Uncrustify: name: Run_Uncrustify if: ${{ github.event.issue.pull_request && github.event.comment.body == '/bot run uncrustify' }} - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 + container: ubuntu:18.04 steps: - name: Dump GitHub context env: @@ -29,17 +30,16 @@ jobs: run: | echo ${{ steps.upstreamrepo.outputs.RemoteRepo }}:${{ steps.upstreambranch.outputs.branchname }} - name: Checkout upstream repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: ${{ steps.upstreamrepo.outputs.RemoteRepo }} ref: ${{ steps.upstreambranch.outputs.branchname }} - name: Install Uncrustify - run: sudo apt-get install uncrustify + run: apt-get update && apt-get install uncrustify - name: Run Uncrustify run: | uncrustify --version find . -iname "*.[hc]" -exec uncrustify -c tools/uncrustify.cfg --no-backup --replace {} + - find . -iname "*.[hc]" -exec uncrustify -c tools/uncrustify.cfg --no-backup --replace {} + - name: Push changes to upstream repository run: | git config --global user.name 'GitHub Action' From 903652656ca1d117d573e6b99682a96ce76ba3a6 Mon Sep 17 00:00:00 2001 From: tony-josi-aws Date: Thu, 30 Mar 2023 14:43:48 +0530 Subject: [PATCH 4/5] fix uncrustify run command --- .github/workflows/uncrustify.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/uncrustify.yml b/.github/workflows/uncrustify.yml index 2e492b8ba6..15a5d9b20b 100644 --- a/.github/workflows/uncrustify.yml +++ b/.github/workflows/uncrustify.yml @@ -34,8 +34,8 @@ jobs: with: repository: ${{ steps.upstreamrepo.outputs.RemoteRepo }} ref: ${{ steps.upstreambranch.outputs.branchname }} - - name: Install Uncrustify - run: apt-get update && apt-get install uncrustify + - name: Install Uncrustify and Git + run: apt-get update && apt-get install uncrustify git-all - name: Run Uncrustify run: | uncrustify --version From 697b7f175b39319c5d821e846010601af443a9b7 Mon Sep 17 00:00:00 2001 From: tony-josi-aws Date: Fri, 31 Mar 2023 09:55:15 +0530 Subject: [PATCH 5/5] fix formatting --- source/FreeRTOS_IPv6.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/source/FreeRTOS_IPv6.c b/source/FreeRTOS_IPv6.c index c623ffb3db..f33495b75c 100644 --- a/source/FreeRTOS_IPv6.c +++ b/source/FreeRTOS_IPv6.c @@ -383,13 +383,13 @@ eFrameProcessingResult_t eHandleIPv6ExtensionHeaders( NetworkBufferDescriptor_t xExtHeaderCount += 1; /* - * IPv6 nodes must accept and attempt to process extension headers in - * any order and occurring any number of times in the same packet, - * except for the Hop-by-Hop Options header which is restricted to - * appear immediately after an IPv6 header only. Outlined - * by RFC 2460 section 4.1 Extension Header Order. - */ - if ( xExtHeaderCount > 1 && xCurrentOrder == 1 ) /* ipIPv6_EXT_HEADER_HOP_BY_HOP */ + * IPv6 nodes must accept and attempt to process extension headers in + * any order and occurring any number of times in the same packet, + * except for the Hop-by-Hop Options header which is restricted to + * appear immediately after an IPv6 header only. Outlined + * by RFC 2460 section 4.1 Extension Header Order. + */ + if( ( xExtHeaderCount > 1 ) && ( xCurrentOrder == 1 ) ) /* ipIPv6_EXT_HEADER_HOP_BY_HOP */ { FreeRTOS_printf( ( "Wrong order. Hop-by-Hop Options header restricted to appear immediately after an IPv6 header\n" ) ); uxIndex = uxMaxLength;