Details
-
Bug
-
Resolution: Fixed
-
Medium
-
None
-
None
-
3
-
9223372036854775807
Description
When using the lnet_sock_setbuf function to set txbufsize and rxbufsize, there is an issue: rxbufsize is incorrectly assigned to sk->sk_sndbuf. This causes both sk_sndbuf and sk_rcvbuf to behave unexpectedly.
This issue was introduced during the refactoring to support kernel 5.8 due to kernel interface changes. Refer to LU-13783.
Code:
void lnet_sock_setbuf(struct socket *sock, int txbufsize, int rxbufsize) { struct sock *sk = sock->sk; if (txbufsize != 0) { sk->sk_userlocks |= SOCK_SNDBUF_LOCK; sk->sk_sndbuf = txbufsize; sk->sk_write_space(sk); } if (rxbufsize != 0) { sk->sk_userlocks |= SOCK_RCVBUF_LOCK; sk->sk_sndbuf = rxbufsize; } }
`sk->sk_sndbuf = rxbufsize` should be `sk->sk_rcvbuf = rxbufsize`.