1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-15 15:06:42 +00:00

Plug sendfile(2) on a listening socket with proper error code.

Reported by:	ngie
Reviewed by:	ngie
Approved by:	re (delphij)
This commit is contained in:
Gleb Smirnoff 2018-10-16 15:57:16 +00:00
parent ac75e35d85
commit 47f1ea5109
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=339379

View File

@ -526,6 +526,8 @@ sendfile_getsock(struct thread *td, int s, struct file **sock_fp,
*so = (*sock_fp)->f_data;
if ((*so)->so_type != SOCK_STREAM)
return (EINVAL);
if (SOLISTENING(*so))
return (ENOTCONN);
return (0);
}