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:
Axel Dörfler
2006-11-10 09:32:11 +00:00
parent 7d50641373
commit 44b3faaa19
@@ -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);