This fixes the crashes when calling {g,s}etsockopt() on an AF_LINK

socket. Not sure, if there are any cases where there is a next protocol,
though. Please review.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25287 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2008-05-02 02:26:58 +00:00
parent 39ae5e4d12
commit 3dba513f4c

View File

@ -323,8 +323,13 @@ status_t
link_getsockopt(net_protocol *protocol, int level, int option, void *value,
int *length)
{
return protocol->next->module->getsockopt(protocol, level, option,
value, length);
if (protocol->next != NULL) {
return protocol->next->module->getsockopt(protocol, level, option,
value, length);
}
return gNetSocketModule.get_option(protocol->socket, level, option, value,
length);
}
@ -332,7 +337,12 @@ status_t
link_setsockopt(net_protocol *protocol, int level, int option,
const void *value, int length)
{
return protocol->next->module->setsockopt(protocol, level, option,
if (protocol->next != NULL) {
return protocol->next->module->setsockopt(protocol, level, option,
value, length);
}
return gNetSocketModule.set_option(protocol->socket, level, option,
value, length);
}