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:
parent
21517f693d
commit
0596ab880e
1 changed files with 2 additions and 0 deletions
|
@ -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 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue