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

nx_packet_length not set in rm_netxduo_ether_receive_packet() #139

Merged
merged 1 commit into from
Oct 28, 2021

Conversation

hwmaier
Copy link
Contributor

@hwmaier hwmaier commented Oct 16, 2021

The rm_netxduo_ether_receive_packet() ISR in file ra\fsp\src\rm_netxduo_ether\rm_netxduo_ether.c did not set the nx_packet_length field and left it set a 0. Subsequent update in line 523:

                        p_nx_buffers[index]->nx_packet_length      -= (NX_ETHERNET_SIZE + padding);

subtracts from 0, resulting in an erroneous length value of 4294967280 which causes issues further upstream in NetXDuo's processing. The nx_packet_append_ptr is also affected.

This PR set the nx_packet_length value based on the received packet's length.

Copy link

@jritchey-renesas jritchey-renesas left a comment

Choose a reason for hiding this comment

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

Confirmed this is a bug. It does seem like NetX Duo will correctly update the nx_packet_length, and nx_packet_append_ptr fields in _nx_ip_packet_receive(), however, if any of these fields are used before they are updated, then this will cause problems.

@kjassmann-renesas kjassmann-renesas merged commit 9787a92 into renesas:master Oct 28, 2021
@jritchey-renesas
Copy link

Closes #148

@hwmaier hwmaier deleted the fix/nx_packet_length branch October 31, 2021 23:15
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.

NetX Duo Ethernet driver does not set NX_PACKET::nx_packet_length
3 participants