* The driver did not handle any non-networking opcodes - including B_SET_NONBLOCKING_IO
and friends; the correct behaviour is to not let those opcodes go deeper in the stack (ie. when calling control() on the socket). * Fixed compilation with debugging output turned on. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19410 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -238,15 +238,10 @@ static status_t
|
|||||||
net_stack_control(void *_cookie, uint32 op, void *data, size_t length)
|
net_stack_control(void *_cookie, uint32 op, void *data, size_t length)
|
||||||
{
|
{
|
||||||
net_stack_cookie *cookie = (net_stack_cookie *)_cookie;
|
net_stack_cookie *cookie = (net_stack_cookie *)_cookie;
|
||||||
status_t status = B_BAD_VALUE;
|
status_t status;
|
||||||
|
|
||||||
TRACE("net_stack_control(%p, %s (0x%lX), %p, %ld)\n",
|
TRACE("net_stack_control(%p, %s (0x%lX), %p, %ld)\n",
|
||||||
_cookie, opcode_name(op), op, data, len);
|
_cookie, opcode_name(op), op, data, length);
|
||||||
|
|
||||||
if (op < NET_STACK_IOCTL_BASE || op > NET_STACK_IOCTL_END) {
|
|
||||||
// we only accept networking ioctl()s to get into our stack
|
|
||||||
return B_BAD_VALUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cookie->socket == NULL) {
|
if (cookie->socket == NULL) {
|
||||||
switch (op) {
|
switch (op) {
|
||||||
@@ -266,6 +261,9 @@ net_stack_control(void *_cookie, uint32 op, void *data, size_t length)
|
|||||||
// in NET_STACK_ACCEPT opcode the cookie (aka the net_stack_cookie!)
|
// in NET_STACK_ACCEPT opcode the cookie (aka the net_stack_cookie!)
|
||||||
// of the file descriptor to use for the new accepted socket
|
// of the file descriptor to use for the new accepted socket
|
||||||
return user_memcpy(data, cookie, sizeof(void *));
|
return user_memcpy(data, cookie, sizeof(void *));
|
||||||
|
|
||||||
|
default:
|
||||||
|
return B_BAD_VALUE;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch (op) {
|
switch (op) {
|
||||||
@@ -456,11 +454,16 @@ net_stack_control(void *_cookie, uint32 op, void *data, size_t length)
|
|||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
if (op < NET_STACK_IOCTL_BASE || op > NET_STACK_IOCTL_END) {
|
||||||
|
// we only accept networking ioctl()s to get into our stack
|
||||||
|
return B_BAD_VALUE;
|
||||||
|
}
|
||||||
|
|
||||||
return sSocket->control(cookie->socket, op, data, length);
|
return sSocket->control(cookie->socket, op, data, length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return B_BAD_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user