-
Notifications
You must be signed in to change notification settings - Fork 749
linux-sgx: implement getpeername, recvfrom and sendto. #1556
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
linux-sgx: implement getpeername, recvfrom and sendto. #1556
Conversation
|
Thanks @wenyongh for the thorough feedback! While applying the requested changes, I noticed Furthermore, I have also handled any returned error by Don't hesitate to share any further observations. |
| } | ||
|
|
||
| static int | ||
| sockaddr_to_bh_sockaddr(const struct sockaddr *sockaddr, socklen_t socklen, |
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.
this is a clone of a function that we have in the posix_socket.c - do you think we can share the code instead of replicating it?
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.
Yes, maybe we add folder core/shared/platform/common/socket and a file under it to implement sockaddr_to_bh_sockaddr and bh_sockaddr_to_sockaddr. But here SGX only supports AF_INET and bh_sockaddr->is_ipv4, the code is a little different from posix's implementation, I think we can merge this PR firstly and refine the code later.
|
LGTM |
…ecodealliance#1556) Implement some of the popular socket APIs left unimplemented for SGX, following the merge of dev/socket.
Hey,
Nothing crazy here, implemented some of the popular socket APIs left unimplemented for SGX, following the merge of
dev/socket.An orthogonal note to this PR: I notice that
posix_socket.c(the backend of POSIX) now handles the structures for ipv4 and ipv6. A next step would also be to port that adaptation for the POSIX backend of SGX.Cheers