Skip to content

Commit e22e358

Browse files
hreineckekuba-moo
authored andcommitted
net/tls: handle MSG_EOR for tls_sw TX flow
tls_sw_sendmsg() already handles 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 negation of MSG_MORE. And erroring out if MSG_EOR is specified with MSG_MORE. Signed-off-by: Hannes Reinecke <[email protected]> Reviewed-by: Jakub Kicinski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 6eaae19 commit e22e358

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

net/tls/tls_sw.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,9 @@ static int tls_sw_sendmsg_locked(struct sock *sk, struct msghdr *msg,
984984
int ret = 0;
985985
int pending;
986986

987+
if (!eor && (msg->msg_flags & MSG_EOR))
988+
return -EINVAL;
989+
987990
if (unlikely(msg->msg_controllen)) {
988991
ret = tls_process_cmsg(sk, msg, &record_type);
989992
if (ret) {
@@ -1193,7 +1196,7 @@ int tls_sw_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)
11931196
int ret;
11941197

11951198
if (msg->msg_flags & ~(MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL |
1196-
MSG_CMSG_COMPAT | MSG_SPLICE_PAGES |
1199+
MSG_CMSG_COMPAT | MSG_SPLICE_PAGES | MSG_EOR |
11971200
MSG_SENDPAGE_NOPOLICY))
11981201
return -EOPNOTSUPP;
11991202

0 commit comments

Comments
 (0)