socket_accept() now checks for SO_ACCEPTCONN before calling the protocol's
accept function to enforce valid codepaths (you need to call listen() before accept()). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19247 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -389,6 +389,9 @@ int
|
||||
socket_accept(net_socket *socket, struct sockaddr *address, socklen_t *_addressLength,
|
||||
net_socket **_acceptedSocket)
|
||||
{
|
||||
if ((socket->options & SO_ACCEPTCONN) == 0)
|
||||
return B_BAD_VALUE;
|
||||
|
||||
net_socket *accepted;
|
||||
status_t status = socket->first_info->accept(socket->first_protocol,
|
||||
&accepted);
|
||||
|
||||
Reference in New Issue
Block a user