mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-09-21 20:22:13 +08:00
net/tls: handle MSG_EOR for tls_device TX flow
tls_push_data() MSG_MORE, but bails out on MSG_EOR. Seeing that MSG_EOR is basically the opposite of MSG_MORE this patch adds handling MSG_EOR by treating it as the absence of MSG_MORE. Consequently we should return an error when both are set. Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Jakub Kicinski <kuba@kernel.org> Link: https://lore.kernel.org/r/20230726191556.41714-3-hare@suse.de Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
e22e358bbe
commit
c004b0e00c
@ -441,9 +441,13 @@ static int tls_push_data(struct sock *sk,
|
||||
long timeo;
|
||||
|
||||
if (flags &
|
||||
~(MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL | MSG_SPLICE_PAGES))
|
||||
~(MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL |
|
||||
MSG_SPLICE_PAGES | MSG_EOR))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
if ((flags & (MSG_MORE | MSG_EOR)) == (MSG_MORE | MSG_EOR))
|
||||
return -EINVAL;
|
||||
|
||||
if (unlikely(sk->sk_err))
|
||||
return -sk->sk_err;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user