-
Notifications
You must be signed in to change notification settings - Fork 208
Use vSocketCloseNextTime instead of FreeRTOS_closesocket #238
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
Use vSocketCloseNextTime instead of FreeRTOS_closesocket #238
Conversation
d682109 to
faf65d6
Compare
|
@htibosch |
htibosch
left a comment
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.
For the readers: FreeRTOS_closesocket() writes to a queue which is read by the IP-task. This writing can fail in case the queue is full. This means that the IP-task better not uses mentioned function.
This PR introduces vSocketCloseNextTime() which can be used by the IP-task only.
@bernd-edlinger : thank you for this PR, I prefer it above the earlier drafts for closesocket().
|
Hmm, the CBMC Proofs fail over the |
913805c to
9300fe7
Compare
|
Hmm, that is a bit unfair, |
|
Hello @bernd-edlinger, the CBMC proofs try to cover every possible scenario. They return an indeterministic value (meaning anything can be returned - I hesitate to say randomly because that would not be correct but can make the nature of the return value clearer). I have been busy with other tasks at hand. I'll try and fix the proofs which are broken in this PR. Regards, |
|
Thanks @AniruddhaKanhere for clarifying. Now I understand a lot better. |
This avoids problems with calling FreeRTOS_closesocket from the IP task.
686c768 to
2897b39
Compare
|
CBMC proofs do now pass. /* Abstraction of xTaskGetCurrentTaskHandle */
TaskHandle_t xTaskGetCurrentTaskHandle( void )
{
static int xIsInit = 0;
static TaskHandle_t pxCurrentTCB;
TaskHandle_t xRandomTaskHandle; /* not initialized on purpose */
if( xIsInit == 0 )
{
pxCurrentTCB = xRandomTaskHandle;
xIsInit = 1;
}
return pxCurrentTCB;
}do you agree with my approach? |
gkwicker
left a comment
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.
One question, see comments.
12eab3e
|
Although merged, this PR was still on my list to do a real-life test. I just took one example: a client wants to connect but it sends the wrong TCP flags (e.g. SYN + FIN). /* In case pxSocket is not yet owned by the application, a closure
* of the socket will be scheduled for the next cycle. */
vTCPStateChange( pxSocket, eCLOSE_WAIT );
Bernd, thank you for this PR, and also for your patience and flexibility. |
This avoids problems with calling FreeRTOS_closesocket
from the IP task.
This is an alternative to #229
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.