-
Notifications
You must be signed in to change notification settings - Fork 713
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
kTLS: implement sendmsg #4147
kTLS: implement sendmsg #4147
Conversation
90e8bdd
to
e4f2cb6
Compare
e4f2cb6
to
9637ba3
Compare
49f2867
to
ab61b19
Compare
ab61b19
to
a2a0909
Compare
23c3f3a
to
60e6dd2
Compare
tls/s2n_ktls_io.c
Outdated
|
||
RESULT_ENSURE(msg_iov->iov_base, S2N_ERR_INVALID_ARGUMENT); |
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.
Why is this check necessary?
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.
We are creating a msghdr using iovec and there is an assumption that iovec is not malformed. This check confirms that assumption. If iovec is NULL then msghdr is also malformed.
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.
Would the iovec be considered malformed if iov_base is NULL and iov_len is 0?
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.
ill check and ban both NULL and 0
.. that seems safer for now and we can support sending 0 later if we need
changed my mind. I'll allow both since we should be able to send 0
data and thats valid.
1f3fa42
to
5dab077
Compare
327c514
to
23e1a6e
Compare
Description of changes:
This PR adds an implementation for s2n_ktls_sendmsg. This essentially takes some data and some record_type and calls the
sendmsg
syscall. It creates amsghdr
and configures the control data on it. Finally it is also doing some error handling (mainly IO blocked error).Call-outs:
Testing:
Unit tests
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.