From 9fad80c34cbe576ec9c9f6124540a044a1bc0dde Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Thu, 28 Jul 2022 02:07:34 +0200 Subject: [PATCH] Kernel: Silently discard `SO_REUSEADDR` We were previously rejecting `SO_REUSEADDR` with an `ENOPROTOOPT`, but that made QEMU unhappy. Instead, just silently discard it and print a FIXME message in case anybody wonders what went wrong if the system won't reuse an address. --- Kernel/Net/Socket.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Kernel/Net/Socket.cpp b/Kernel/Net/Socket.cpp index 7a46ba1d0f..1b8e75c13a 100644 --- a/Kernel/Net/Socket.cpp +++ b/Kernel/Net/Socket.cpp @@ -125,6 +125,9 @@ ErrorOr Socket::setsockopt(int level, int option, Userspace u m_routing_disabled = TRY(copy_typed_from_user(static_ptr_cast(user_value))) != 0; return {}; } + case SO_REUSEADDR: + dbgln("FIXME: SO_REUSEADDR requested, but not implemented."); + return {}; default: dbgln("setsockopt({}) at SOL_SOCKET not implemented.", option); return ENOPROTOOPT;