-
Notifications
You must be signed in to change notification settings - Fork 163
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
Do not clear pxEndPoint in TCPReturnPacket() #1078
Do not clear pxEndPoint in TCPReturnPacket() #1078
Conversation
/bot run formatting |
021212f
to
3133530
Compare
} | ||
else | ||
{ | ||
pvCopySource = &pxEthernetHeader->xSourceAddress; | ||
} | ||
|
||
if( pxNetworkBuffer->pxEndPoint == NULL ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially I had some confusion whether eARPGetCacheEntry will return a eARPCacheHit or eARPCacheMiss in this schenario and if the check (pxNetworkBuffer->pxEndPoint == NULL ) needs to be inside the return value check or outside as it is now. However, on some more exploration and internal discussions, it is clear that eARPGetCacheEntry will return eARPCacheMiss and the check can be outside and it will not have any other side-effect. With this I am good with the change.
Description
In response to issue #1077 :
@XIAO-Q7, thank you for reporting the issue and for the research that you did. Also thanks to @evpopov who encountered the same problem.
I managed to reproduce the problem if I use the following configuration:
DUT tries to connect to remote device, but
eARPGetCacheEntry()
clears the endpoint, which leads to a dereference of NULL.Here is a summary of the proposed change:
I hadn't had the time to check the code coverage yet.
Test Steps
Use a similar configuration and try to connect to the remote device.
Checklist:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.