Skip to content

Commit

Permalink
Include ICMP while calculating IP header checksum (FreeRTOS#198)
Browse files Browse the repository at this point in the history
* Fix compiler warnings when the TCP Window is not used (FreeRTOS#124)

* Fix warnings when TCP window is not used

* Uncrustify

* Move local variables to inner loop in prvNetworkInterfaceInput() (FreeRTOS#144)

Co-authored-by: Hein Tibosch <[email protected]>
Co-authored-by: Aniruddha Kanhere <[email protected]>

* Update litani submodule (FreeRTOS#147)

Co-authored-by: Mark R. Tuttle <[email protected]>

* Fix doxygen check (FreeRTOS#149)

* Update doxygen version

* update the config file

* TCP_WIN: fix compile warning on x86_64 (FreeRTOS#148)

* TCP_WIN: fix compile warning on x86_64

Fix the following warning when building for 64 bit:

warning: conversion from ‘long unsigned int’ to ‘uint32_t’ {aka ‘unsigned int’} changes value from ‘18446744073709551615’ to ‘4294967295’ [-Woverflow]
             uint32_t ulReturn = ~0UL;
                                 ^

* Update FreeRTOS_TCP_WIN.c

Co-authored-by: Aniruddha Kanhere <[email protected]>

Co-authored-by: Thomas Pedersen <[email protected]>
Co-authored-by: Aniruddha Kanhere <[email protected]>

* fix deprecated volatile compound assignment (FreeRTOS#152)

* fixed deprecated volatile compound assignment

C++20 deprecates some undefined or unclear use cases of 'volatile' like
compound assignments and compliant compilers warn about those deprecated
operations.

In vStreamBufferMoveMid the deprecated compound assignment and other
direct accesses to volatile 'StreamBuffer_t->uxMid' is replaced using a
local variable stored back when done.

* Uncrustify

Co-authored-by: Aniruddha Kanhere <[email protected]>
Co-authored-by: Aniruddha Kanhere <[email protected]>

* FreeRTOS_ARP.c : store local addresses only (FreeRTOS#120)

* FreeRTOS_ARP.c : store local addresses only

* Added the function xARPWaitResolution()

* Added an entry to lexicon.txt.

* Ran Uncrustify

* Update unit test file

* Update

* Declared xARPWaitResolution() in FreeRTOS_IP.h

* Compare the result of xIsCallingFromIPTask() with pdFALSE in stead of 0

Co-authored-by: Hein Tibosch <[email protected]>
Co-authored-by: Aniruddha Kanhere <[email protected]>
Co-authored-by: Aniruddha Kanhere <[email protected]>

* Remove unnecessary #ifndef (FreeRTOS#186)

* Add entropy

* remove warning

* Remove unnecessary ifndef

* Remove unwanted changes

* Don't Fragment Flags patch. (FreeRTOS#179)

* Moves all IP flag defines in FreeRTOS_IP_Private.h so that they are accessible to all protocols
Adds definitions for the IP fragmentation flags
Modifies the fragmentation check for incoming frames to drop both the first and later fragments.
Sets the "don't fragment" flag for all outgoing IP frames ( ICMP, DNS, UDP, TCP )
Removes ipGET_UDP_PAYLOAD_OFFSET_FOR_FRAGMENT as it appears obsolete. The stack never outputs fragments.

* Uncrustified

* Uncrustify

* Fixes the fragment offset and fragmentation flags masks ( 0x0FFF and 0xF000 -> 0x1FFF and 0xE000 )
Adds a configuration define ( ipconfigADVERTISE_DONT_FRAGMENT_FLAG ) as suggested by htibosch with a default value of zero for backwards compatibility
Updates the comment that explains the discarding of incoming fragments as discussed with Aniruddha Kanhere

* Adds the 'U' qualifier as requested by hs2gh
fixes a typo in FreeRTOSIPConfigDefaults.h

* Shortens the comment in FreeRTOSIPConfigDefaults as per htibosch's suggestion.

* Renames ipconfigADVERTISE_DONT_FRAGMENT to ipconfigFORCE_IP_DONT_FRAGMENT

* same as last commit, simply forgot to save this before pushing.

Co-authored-by: Emil Popov <[email protected]>
Co-authored-by: Aniruddha Kanhere <[email protected]>

* fix IP buffer padding check on 64bit (FreeRTOS#146)

* fix IP buffer padding check on 64bit

On 64 bit systems, FreeRTOS_IPInit() would assert
ipconfigBUFFER_PADDING was equal to 14 to "make sure there
is enough space in pucEthernetBuffer to store a pointer."

This prevents the driver from requesting additional
padding, so make the assert greater than or equal to 14.

Also use the final ipBUFFER_PADDING value instead of
ipconfigBUFFER_PADDING, which is probably what was
intended?

* Update after comments

Co-authored-by: Thomas Pedersen <[email protected]>
Co-authored-by: Aniruddha Kanhere <[email protected]>

* Update readme.md (FreeRTOS#189)

Just fixing the "table of 3 types of STH32H7" so that it renders in github webpage.  I had a tough time reading that table until I looked at the md source.
You could also just put code fences around it:
~~~
/**
 * RAM area	H747	H743	H742	Location
 * ------------------------------------------------
 * DTCM		128k	128k	128k	0x20000000
 * AXI-SRAM	511k	511k	384k	0x24000000
 *
 * SRAM1	128k	128k	32k		0x30000000
 * SRAM2	128k	128k	16k		0x30020000
 * SRAM3	32k		32k	 	-		0x30040000
 * SRAM4	64k		64k		64k		0x38000000
 * Backup   SRAM	4k		4k	4k	0x38800000
 */
~~~

Co-authored-by: Aniruddha Kanhere <[email protected]>

* Update files referencing aws_application_version.h to use iot_application_version.h (FreeRTOS#188)

* Update files referencing aws_application_version.h to use iot_application_version.h

* Remove pic32 ethernet _Command_Version function to remove dependency on iot_application_version.h from amazon-freertos repository.

* Remove function defs from header files (FreeRTOS#190)

* Add entropy

* remove warning

* Remove function defs from headers

* Some corrections

* More fixes and uncrustify

* Remove the BaseType min function

* Doxygen

* Fix one CBMC proof

* More cbmc proof fixes

* More cbmc fixes

* Some doxygen additions

* Update last CBMC proof

* Doxygen comments

* Doxygen updates

* Doxygen and spell check

* Spell check and unit-test

* Unit test fix

* Update after comments

* Update 2 after comments

* Move function around

* Uncrustify

* Update after comments

Co-authored-by: Gary Wicker <[email protected]>

* Do not release a network buffer if it equals to NULL (FreeRTOS#191)

Co-authored-by: Hein Tibosch <[email protected]>
Co-authored-by: Aniruddha Kanhere <[email protected]>

* Circumvent Qemu MPS2 networking bug (FreeRTOS#142)

* Add support for MPS2 networking with lan9118/lan9220

* Fix uncrustify errors

* Enable network interrupt handling

* Add network interrupt support to Qemu MPS2 AN385

* Fix function comment

* Fix Uncrustify errors

* Fix Uncrustify errors

* Fix Uncrustify Errors

* Fix typo

* Cirumvent Qemu MPS2 network bug

* Remove commented code, add doxygen comment

* Add a project for static analysis (FreeRTOS#195)

* Add entropy

* remove warning

* Remove unwanted changes

* Update tcp_mem_stats.c

* Add Coverity

* Remove unused files

* Add some features

* clean up

* More clean up

* Unwanted additions removal

* Clean up

* Add 32-bit compile option

* Update after comments

* Uncrustify

* Include ICMP checksum

* Uncrustify

* Update ci.yml

* Spell check

Co-authored-by: Hein Tibosch <[email protected]>
Co-authored-by: Hein Tibosch <[email protected]>
Co-authored-by: Mark Tuttle <[email protected]>
Co-authored-by: Mark R. Tuttle <[email protected]>
Co-authored-by: Thomas Pedersen <[email protected]>
Co-authored-by: Thomas Pedersen <[email protected]>
Co-authored-by: Hartmut Schaefer <[email protected]>
Co-authored-by: evpopov <[email protected]>
Co-authored-by: Emil Popov <[email protected]>
Co-authored-by: shrewmouse1 <[email protected]>
Co-authored-by: Paul Bartell <[email protected]>
Co-authored-by: Gary Wicker <[email protected]>
Co-authored-by: alfred gedeon <[email protected]>
  • Loading branch information
14 people authored Feb 24, 2021
1 parent f052237 commit 428ad5a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
fi
formatting:
runs-on: ubuntu-latest
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Install Uncrustify
Expand Down
12 changes: 9 additions & 3 deletions FreeRTOS_IP.c
Original file line number Diff line number Diff line change
Expand Up @@ -1890,9 +1890,15 @@ static eFrameProcessingResult_t prvAllowIPPacket( const IPPacket_t * const pxIPP
* define, so that the checksum won't be checked again here */
if( eReturn == eProcessBuffer )
{
/* Is the IP header checksum correct? */
if( ( pxIPHeader->ucProtocol != ( uint8_t ) ipPROTOCOL_ICMP ) &&
( usGenerateChecksum( 0U, ( uint8_t * ) &( pxIPHeader->ucVersionHeaderLength ), ( size_t ) uxHeaderLength ) != ipCORRECT_CRC ) )
/* Is the IP header checksum correct?
*
* NOTE: When the checksum of IP header is calculated while not omitting
* the checksum field, the resulting value of the checksum always is 0xffff
* which is denoted by ipCORRECT_CRC. See this wiki for more information:
* https://en.wikipedia.org/wiki/IPv4_header_checksum#Verifying_the_IPv4_header_checksum
* and this RFC: https://tools.ietf.org/html/rfc1624#page-4
*/
if( usGenerateChecksum( 0U, ( uint8_t * ) &( pxIPHeader->ucVersionHeaderLength ), ( size_t ) uxHeaderLength ) != ipCORRECT_CRC )
{
/* Check sum in IP-header not correct. */
eReturn = eReleaseBuffer;
Expand Down

0 comments on commit 428ad5a

Please sign in to comment.