Kernel: Don't put closed/listener sockets into the closing_sockets list

This commit is contained in:
Gunnar Beutner 2021-04-30 19:19:53 +02:00 committed by Andreas Kling
parent d8f92bdf96
commit 866e577f1d
Notes: sideshowbarker 2024-07-18 18:51:22 +09:00

View file

@ -471,8 +471,10 @@ KResult TCPSocket::close()
set_state(State::LastAck);
}
Locker locker(closing_sockets().lock());
closing_sockets().resource().set(tuple(), *this);
if (state() != State::Closed && state() != State::Listen) {
Locker locker(closing_sockets().lock());
closing_sockets().resource().set(tuple(), *this);
}
return result;
}