瀏覽代碼

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.
Tim Schumacher 3 年之前
父節點
當前提交
9fad80c34c
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      Kernel/Net/Socket.cpp

+ 3 - 0
Kernel/Net/Socket.cpp

@@ -125,6 +125,9 @@ ErrorOr<void> Socket::setsockopt(int level, int option, Userspace<void const*> u
         m_routing_disabled = TRY(copy_typed_from_user(static_ptr_cast<int const*>(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;