svn commit: r358965 - in head: lib/libc/sys sys/kern
Michael Tuexen
tuexen at FreeBSD.org
Fri Mar 13 18:38:29 UTC 2020
Author: tuexen
Date: Fri Mar 13 18:38:28 2020
New Revision: 358965
URL: https://svnweb.freebsd.org/changeset/base/358965
Log:
sendfile() does currently not support SCTP sockets.
Therefore, fail the call.
Reviewed by: markj@
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24059
Modified:
head/lib/libc/sys/sendfile.2
head/sys/kern/kern_sendfile.c
Modified: head/lib/libc/sys/sendfile.2
==============================================================================
--- head/lib/libc/sys/sendfile.2 Fri Mar 13 17:10:53 2020 (r358964)
+++ head/lib/libc/sys/sendfile.2 Fri Mar 13 18:38:28 2020 (r358965)
@@ -431,3 +431,12 @@ to
.Er EFAULT ,
if provided an invalid address for
.Fa sbytes .
+The
+.Fn sendfile
+system call does not support SCTP sockets,
+it will return
+.Dv -1
+and set
+.Va errno
+to
+.Er EINVAL.
Modified: head/sys/kern/kern_sendfile.c
==============================================================================
--- head/sys/kern/kern_sendfile.c Fri Mar 13 17:10:53 2020 (r358964)
+++ head/sys/kern/kern_sendfile.c Fri Mar 13 18:38:28 2020 (r358965)
@@ -575,6 +575,12 @@ sendfile_getsock(struct thread *td, int s, struct file
*so = (*sock_fp)->f_data;
if ((*so)->so_type != SOCK_STREAM)
return (EINVAL);
+ /*
+ * SCTP one-to-one style sockets currently don't work with
+ * sendfile(). So indicate EINVAL for now.
+ */
+ if ((*so)->so_proto->pr_protocol == IPPROTO_SCTP)
+ return (EINVAL);
if (SOLISTENING(*so))
return (ENOTCONN);
return (0);
More information about the svn-src-head
mailing list