Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix in ATSAME5x network interface. Incorrect detection of ICMP #1194

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cruxic
Copy link

@cruxic cruxic commented Sep 27, 2024

A fix for issue #1193.

Note: although I have an ATSAME53 board, I have not compiled or executed the code in this pull-request. My own project uses a customized version of this code.

I also noticed that this same bug exists in the MSP432 driver. This pull-request does not fix that.

@cruxic cruxic requested a review from a team as a code owner September 27, 2024 18:25
Copy link
Member

@jasonpcarroll jasonpcarroll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @cruxic ,
Thank you for this PR. Looks fine to me. I do not currently have an ATSAME5x with me - would you mind running this version of your code in your project and verifying that it works?

Copy link
Contributor

@htibosch htibosch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please have a look at this slightly modified version:

NetworkInterface.new.v2.zip

if( pxIPPacket->xIPHeader.ucProtocol == ( uint8_t ) ipPROTOCOL_ICMP )
{
* It must therefore be implemented in software. */
if ( isICMP(pxBufferDescriptor) ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The if statement expects a boolean value. The function isICMP() returns an integer value. The only way to satisfy the compiler is as follows:

if( isICMP( pxBufferDescriptor ) == pdTRUE )
{
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants