1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 03:47:34 +00:00

Kernel: connect() should EISCONN on already-connected LocalSocket

This was causing us to try and accept the same client socket multiple
times on the server side, tripping an assertion in Socket::accept().
This commit is contained in:
Andreas Kling 2020-01-09 21:30:56 +01:00
parent 21517f693d
commit 0596ab880e

View file

@ -105,6 +105,8 @@ KResult LocalSocket::connect(FileDescription& description, const sockaddr* addre
return KResult(-EINVAL);
if (address->sa_family != AF_LOCAL)
return KResult(-EINVAL);
if (is_connected())
return KResult(-EISCONN);
const sockaddr_un& local_address = *reinterpret_cast<const sockaddr_un*>(address);
char safe_address[sizeof(local_address.sun_path) + 1] = { 0 };