mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
sock: pass protocol to sockets
This commit is contained in:
@@ -28,7 +28,7 @@ syscallret_t syscall_accept(context_t *, int oldfd, abisockaddr_t *abisockaddr,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
socket_t *client = socket_create(server->type);
|
||||
socket_t *client = socket_create(server->type, server->protocol);
|
||||
if (client == NULL) {
|
||||
ret.errno = ENOMEM;
|
||||
goto cleanup;
|
||||
|
||||
@@ -43,7 +43,7 @@ syscallret_t syscall_socket(context_t *, int domain, int type, int protocol) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
socket_t *socket = socket_create(socktype);
|
||||
socket_t *socket = socket_create(socktype, protocol);
|
||||
if (socket == NULL) {
|
||||
ret.errno = ENOMEM;
|
||||
return ret;
|
||||
|
||||
@@ -37,9 +37,9 @@ syscallret_t syscall_socketpair(context_t *, int domain, int type, int protocol)
|
||||
|
||||
// create pair
|
||||
if (type == SOCK_SEQPACKET)
|
||||
ret.errno = localsock_pair_seqpacket(&sock1, &sock2);
|
||||
ret.errno = localsock_pair_seqpacket(&sock1, &sock2, protocol);
|
||||
else
|
||||
ret.errno = localsock_pair(&sock1, &sock2);
|
||||
ret.errno = localsock_pair(&sock1, &sock2, protocol);
|
||||
if (ret.errno)
|
||||
return ret;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user