Author: glebius
Date: Tue Oct 16 15:57:16 2018
New Revision: 339379
URL: https://svnweb.freebsd.org/changeset/base/339379
Log:
Plug sendfile(2) on a listening socket with proper error code.
Reported by: ngie
Reviewed by: ngie
Approved by: re (delphij)
Modified:
head/sys/kern/kern_sendfile.c
Modified: head/sys/kern/kern_sendfile.c
==============================================================================
--- head/sys/kern/kern_sendfile.c Tue Oct 16 14:41:09 2018
(r339378)
+++ head/sys/kern/kern_sendfile.c Tue Oct 16 15:57:16 2018
(r339379)
@@ -526,6 +526,8 @@ sendfile_getsock(struct thread *td, int s, struct file
*so = (*sock_fp)->f_data;
if ((*so)->so_type != SOCK_STREAM)
return (EINVAL);
+ if (SOLISTENING(*so))
+ return (ENOTCONN);
return (0);
}
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"