You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should distinguish stream (TCP) and datagram (UDP) protocols here. As was discussed in https://github.com/fridex/af_ktls/pull/28. This should be a full list of scenarios that can happen:
for DTLS/UDP:
EBADF when peeked size is bigger then we expect based on header
EBADF when peeked size is smaller then we expect based on header (or does not cover header at all)
when equal, process
for TLS/TCP:
when peeked size is bigger than size based on TLS header, process only TLS record - part based on TLS header
when peeked size is smaller than size based on TLS header or it does not cover header at all (possibly segmented):
EAGAIN for nonblocking socket
block for blocking socket
when equal, proces
Can we peek only once (not a separate peek for header and then for the record)?
for DTLS/UDP it should be pretty straight forward, since when we do the peek, the whole datagram should be already available
for TLS/TCP:
since we explicitly know where is the beginning and the end of the TLS record, we could wait/report when there is not enough data
for nonblocking socket scenario, there can be incosistency in return value:
not enough data received to handle whole record - kernel will return EAGAIN
received whole record, but it was not possible to decrypt it - kernel will return EBADF (probably)
Note this will occur even with double-peek approach
Nevertheless, peek is not a big deal though (as discussed in #28).
Based on https://github.com/fridex/af_ktls/pull/28 I am open to discussion whether there can be only one peek or two peeks per
kernel_recvmsg()
andsplice_read
.We should distinguish stream (TCP) and datagram (UDP) protocols here. As was discussed in https://github.com/fridex/af_ktls/pull/28. This should be a full list of scenarios that can happen:
Can we peek only once (not a separate peek for header and then for the record)?
Note this will occur even with double-peek approach
Nevertheless, peek is not a big deal though (as discussed in #28).
Any suggestions?
related: https://github.com/fridex/af_ktls/pull/28 https://github.com/fridex/af_ktls/issues/21
The text was updated successfully, but these errors were encountered: