-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kernel/Net: Implement SO_SNDBUF and SO_RCVBUF for getsockopt #25012
base: master
Are you sure you want to change the base?
Conversation
Kernel/Net/LocalSocket.cpp
Outdated
if (size < sizeof(size_t)) | ||
return EINVAL; | ||
buffer_size = m_for_server.ptr()->space_for_writing(); | ||
TRY(copy_to_user(static_ptr_cast<int*>(value), bit_cast<int*>(&buffer_size))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, the pointer cast is utterly wrong and the type is size_t. This bit_cast is wrong and will be UB on big-endian systems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what cast should be used here? pointer cast seems to be used on everywhere else
3485f89
to
11384da
Compare
Hello! One or more of the commit messages in this PR do not match the SerenityOS code submission policy, please check the |
ff3107b
to
84dabd3
Compare
4372ed2
to
9fa49ec
Compare
These options are used for QoS and return buffer length as response. We currently don't support setting the buffer size.
These options are generally used for QoS tuning by Apache, NGINX, MySQL etc. (insert anything that scales here)