-
Notifications
You must be signed in to change notification settings - Fork 681
Fix usrsocktest errors #85
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
Fix usrsocktest errors #85
Conversation
|
@masayuki2009 how about remove Make.defs patch from this PR? so I can merge it. |
|
@xiaoxiang781216 sorry, I added the file by mistake. |
NOTE: Because sin_zero field is just a padding, so should be ignored. Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
98fe225 to
9a635c2
Compare
|
@xiaoxiang781216 Sorry, I've just pushed with -f |
|
@masayuki2009 no problem, I have merged it, thanks for your patch. |
|
It fix fails in NoBlockRecv and BlockRecv, yes, thanks! By the way, when I was investigating this I encountered on this sentence in stackoverflow:
I'm too far from an expert in net stack, and don't know about any specification, but maybe (just a thought) it would be more correct to nulling padding somewhere inside the net stack? |
Thanks for the comment. I'll check the article. |
|
But I think the requirement is the application should zero out the input addr before pass to socket API to avoid the undefined behaviour? addr is an output argument in our case. |
It was the first thing I did trying fix it - clear input addr in usrsocktest before pass to socket API, but netstack insert random values in sin_zero itself anyway. |
Actually recvfrom_request() in usrsocktest_daemon.c sets the return values, |
As far as I checked the Linux kernel source code, you are right. Anyway, I'll try to implement it and then should be reviewed by @patacongo. |
|
If so other similar function accept, getsockname getpeername... need the similar change too |
Thanks for the comments. I understand. |
|
I've just sent a new PR. apache/nuttx#370 |
Summary
Impact
Limitations / TODO
Testing