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:
parent
ac81f2f2c7
commit
7e66c109f2
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user