From 9c7659306a7d072f1c3b701533436c45644df693 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 17 Dec 2021 00:05:03 +0100 Subject: [PATCH] Kernel: Fix getsockopt(SO_RCVTIMEO) returning wrong timeout We were returning the send timeout for both SO_RCVTIMEO and SO_SNDTIMEO. --- Kernel/Net/Socket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/Net/Socket.cpp b/Kernel/Net/Socket.cpp index 20b40318cc..224e9bcc7c 100644 --- a/Kernel/Net/Socket.cpp +++ b/Kernel/Net/Socket.cpp @@ -162,7 +162,7 @@ ErrorOr 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(value), &tv)); } size = sizeof(timeval);