You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current implementation of getsockopt and setsockopt has some issues and may need a overhaul:
The design of the option value and the way the option is set might not be appropriate and may lead to issues like overflowing the flag
Some Linux socket options constants are missing. Instead these option constants seem to be from other OS like MacOS.
Linux implementation of sockopt syscalls is using two layer of flags. The first layer of flag is what the user is using (SO_LINGER, SO_OOBINLINE, etc) and is valued based on bit position (0x01, 0x04, 0x08, etc). Upon receiving these options, Linux will use another internal flag to actually set the socket options stored in sk_flags. These internal flags are enum type and are therefore valued in sequence instead. when set, Linux is calling __set_bit to set the corresponding bit refered by internal flag in sk_flags.
The text was updated successfully, but these errors were encountered:
Current implementation of getsockopt and setsockopt has some issues and may need a overhaul:
Linux implementation of sockopt syscalls is using two layer of flags. The first layer of flag is what the user is using (SO_LINGER, SO_OOBINLINE, etc) and is valued based on bit position (0x01, 0x04, 0x08, etc). Upon receiving these options, Linux will use another internal flag to actually set the socket options stored in sk_flags. These internal flags are enum type and are therefore valued in sequence instead. when set, Linux is calling
__set_bit
to set the corresponding bit refered by internal flag in sk_flags.The text was updated successfully, but these errors were encountered: