Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions Kernel/Net/Socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,10 @@ ErrorOr<void> Socket::setsockopt(int level, int option, Userspace<void const*> u
return {};
}
case SO_REUSEADDR:
dbgln("FIXME: SO_REUSEADDR requested, but not implemented.");
return {};
// FIXME: Implement SO_REUSEADDR. Currently we just fail since the
// bind() behavior isn't implemented yet and pretending it works
// would be misleading to applications.
return ENOPROTOOPT;
case SO_BROADCAST: {
if (user_value_size != sizeof(int))
return EINVAL;
Expand Down Expand Up @@ -241,14 +243,9 @@ 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_REUSEADDR:
// FIXME: Implement SO_REUSEADDR
return ENOPROTOOPT;
case SO_BROADCAST: {
int broadcast_allowed = m_broadcast_allowed ? 1 : 0;
if (size < sizeof(broadcast_allowed))
Expand Down
Loading