Message ID | 20240514011335.176158-4-martineau@kernel.org (mailing list archive) |
---|---|
State | Accepted |
Commit | ce5f6f71b029f6a96267a7d876da4a055d7d1611 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | mptcp: small improvements, fix and clean-ups | expand |
Context | Check | Description |
---|---|---|
netdev/tree_selection | success | Clearly marked for net-next |
netdev/apply | success | Patch already applied to net-next-0 |
diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c index fcca9433c858..a77b33488176 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);