mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-11 17:00:37 +00:00
Kernel: Stub out getsockopt for the SO_REUSEADDR option
We currently discard setsockopt for SO_REUSEADDR, so to ensure consistency, support getsockopt as well.
This commit is contained in:
parent
545f4b6cc1
commit
dca5c71e53
Notes:
sideshowbarker
2024-07-17 09:39:38 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/dca5c71e53 Pull-request: https://github.com/SerenityOS/serenity/pull/22420
1 changed files with 8 additions and 0 deletions
|
@ -241,6 +241,14 @@ ErrorOr<void> Socket::getsockopt(OpenFileDescription&, int level, int option, Us
|
|||
size = sizeof(routing_disabled);
|
||||
return copy_to_user(value_size, &size);
|
||||
}
|
||||
case SO_REUSEADDR: {
|
||||
int reuse_address = 0;
|
||||
if (size < sizeof(reuse_address))
|
||||
return EINVAL;
|
||||
TRY(copy_to_user(static_ptr_cast<int*>(value), &reuse_address));
|
||||
size = sizeof(reuse_address);
|
||||
return copy_to_user(value_size, &size);
|
||||
}
|
||||
case SO_BROADCAST: {
|
||||
int broadcast_allowed = m_broadcast_allowed ? 1 : 0;
|
||||
if (size < sizeof(broadcast_allowed))
|
||||
|
|
Loading…
Reference in a new issue