svn commit: r339379 - head/sys/kern

Gleb Smirnoff glebius at FreeBSD.org
Tue Oct 16 15:57:17 UTC 2018


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);
 }
 


More information about the svn-src-head mailing list