1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:28:11 +00:00

Kernel: Fix getsockopt(SO_RCVTIMEO) returning wrong timeout

We were returning the send timeout for both SO_RCVTIMEO and SO_SNDTIMEO.
This commit is contained in:
Andreas Kling 2021-12-17 00:05:03 +01:00
parent c175cea32d
commit 9c7659306a

View file

@ -162,7 +162,7 @@ ErrorOr<void> Socket::getsockopt(OpenFileDescription&, int level, int option, Us
if (size < sizeof(timeval))
return EINVAL;
{
timeval tv = m_send_timeout.to_timeval();
timeval tv = m_receive_timeout.to_timeval();
TRY(copy_to_user(static_ptr_cast<timeval*>(value), &tv));
}
size = sizeof(timeval);