Closed mjmartineau closed 9 months ago
@mjmartineau Mat, do you mean to change it like this:
static inline bool sk_is_mptcp(const struct sock *sk)
{
return sk_is_tcp(sk) ? tcp_sk(sk)->is_mptcp : false;
}
As noted on the mailing list (https://lore.kernel.org/mptcp/CABbSpchzSj9jn1-t_nmamRf+oH61jecwDw08mr9U1YP9dnw8Pg@mail.gmail.com/) - instead of changing this function, will depend on extra checks with CONFIG_DEBUG_NET
in the mptcp code: https://lore.kernel.org/mptcp/20240201-mptcp-check-protocol-v2-2-1e253ef51990@kernel.org/
This avoids churn and extra execution overhead in the TCP code.
sk_is_mptcp()
looks like it can be called using anystruct sock *
, but it only gives valid results withstruct tcp_sock *
:All existing callers use it correctly.
We could rename it to something like
tcpsk_is_mptcp()
, or keep the existing name and add ask_is_tcp()
check.