mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 06:04:57 +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
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…
Add table
Add a link
Reference in a new issue