Message ID | 20240510-upstream-net-next-20240509-misc-improvements-v1-3-4f25579e62ba@kernel.org (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | mptcp: small improvements, fix and clean-ups | expand |
diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c index 63a3edc75857..cc9ecccf219d 100644 --- a/net/mptcp/sockopt.c +++ b/net/mptcp/sockopt.c @@ -999,6 +999,10 @@ static int mptcp_getsockopt_info(struct mptcp_sock *msk, char __user *optval, in if (get_user(len, optlen)) return -EFAULT; + /* When used only to check if a fallback to TCP happened. */ + if (len == 0) + return 0; + len = min_t(unsigned int, len, sizeof(struct mptcp_info)); mptcp_diag_fill_info(msk, &m_info);