tcp: don't allow read on listening sockets
fix #18884 Change-Id: If4e337316ea4faa2f00fa73295c57e93de0a2cbc Reviewed-on: https://review.haiku-os.org/c/haiku/+/7616 Reviewed-by: waddlesplash <[email protected]> Tested-by: Commit checker robot <[email protected]> Reviewed-by: Rene Gollent <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
979a0bc487
commit
51bce128f7
@@ -942,7 +942,7 @@ TCPEndpoint::ReadData(size_t numBytes, uint32 flags, net_buffer** _buffer)
|
||||
|
||||
*_buffer = NULL;
|
||||
|
||||
if (fState == CLOSED) {
|
||||
if (fState == CLOSED || fState == LISTEN) {
|
||||
if (socket->error != B_OK)
|
||||
return socket->error;
|
||||
return ENOTCONN;
|
||||
|
||||
Reference in New Issue
Block a user