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

[BUG] The endpoint with the NULL address is operated in prvTCPReturnPacket_IPV4 function #1077

Closed
XIAO-Q7 opened this issue Jan 19, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@XIAO-Q7
Copy link

XIAO-Q7 commented Jan 19, 2024

Describe the bug

When a endpoint enables DHCP and sets a AUTO IP. Receiving a tcp socket packet from a non-AUTOIP network segment causes the endpoint with a null address to be operated on in the prvTCPReturnPacket_IPV4 function.

Target

Any

To Reproduce
Plus_TCP_BUG

  • Configure: An endpoint enable DHCP and set a AUTO IP

In my case, I'm running Plus TCP on an STM32 and built a TCP echo server, employing a computer as the echo client. When I send an echo frame to the server, the microcontroller runs into HardFault_Handler.

Expected behavior

Server correctly returns echo frames.

I have set a special IP address for the computer in this case, not the AUTOIP segment. If PLUS TCP can't automatically find an entry point to send frames. It can not send the frame. I don't want the chip to enter HardFault_Handler.

Additional context

Through my debugging, I found that in the prvTCPReturnPacket_IPV4 function, the line of code here gives an endpoint to a null address.

eResult = eARPGetCacheEntry( &ulDestinationIPAddress, &xMACAddress, &( pxNetworkBuffer->pxEndPoint ) );

and later operates this endpoint with a null address to send frames, eventually causing the chip to run into HardFault_Handler.

NetworkInterface_t * pxInterface = pxNetworkBuffer->pxEndPoint->pxNetworkInterface;
( void ) pxInterface->pfOutput( pxInterface, pxNetworkBuffer, xDoRelease );
@XIAO-Q7 XIAO-Q7 added the bug Something isn't working label Jan 19, 2024
@htibosch
Copy link
Contributor

Hello @XIAO-Q7 , thanks a lot for reporting this.
I'm trying to reproduce it, and a fix is on its way.
Thanks

@tony-josi-aws
Copy link
Member

@XIAO-Q7, we have merged #1078 that should be fixing the issue reported, if possible, please verify if the fix works for you by pulling the latest changes from main.

@XIAO-Q7
Copy link
Author

XIAO-Q7 commented Jan 30, 2024

Yes, it worked. Thank you for your help.

@XIAO-Q7 XIAO-Q7 closed this as completed Jan 30, 2024
@tony-josi-aws
Copy link
Member

Thanks for verifying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants