mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-13 06:32:54 +00:00
Kernel: Return ENOPROTOOPT instead of asserting on unimplemented levels in getsockopt
This commit is contained in:
parent
93b9929391
commit
ec136db592
Notes:
sideshowbarker
2024-07-19 02:11:46 +09:00
Author: https://github.com/Lubrsi
Commit: ec136db592
Pull-request: https://github.com/SerenityOS/serenity/pull/3454
Reviewed-by: https://github.com/bugaevc
1 changed files with 6 additions and 1 deletions
|
@ -156,7 +156,12 @@ KResult Socket::getsockopt(FileDescription&, int level, int option, Userspace<vo
|
|||
if (!copy_from_user(&size, value_size.unsafe_userspace_ptr()))
|
||||
return KResult(-EFAULT);
|
||||
|
||||
ASSERT(level == SOL_SOCKET);
|
||||
// FIXME: Add TCP_NODELAY, IPPROTO_TCP and IPPROTO_IP (used in OpenSSH)
|
||||
if (level != SOL_SOCKET) {
|
||||
// Not sure if this is the correct error code, but it's only temporary until other levels are implemented.
|
||||
return KResult(-ENOPROTOOPT);
|
||||
}
|
||||
|
||||
switch (option) {
|
||||
case SO_SNDTIMEO:
|
||||
if (size < sizeof(timeval))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue