Hi Jiayuan,
On 30/11/2025 04:23, Jiayuan Chen wrote:
The sockmap feature allows bpf syscall from userspace, or based on bpf sockops, replacing the sk_prot of sockets during protocol stack processing with sockmap's custom read/write interfaces.
(...)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 1dbc62537259..13e3510e6c8f 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -79,8 +79,9 @@ static u64 mptcp_wnd_end(const struct mptcp_sock *msk) static bool mptcp_is_tcpsk(struct sock *sk) { struct socket *sock = sk->sk_socket;
- unsigned short family = READ_ONCE(sk->sk_family);
- if (unlikely(sk->sk_prot == &tcp_prot)) {
- if (unlikely(family == AF_INET)) { /* we are being invoked after mptcp_accept() has
- accepted a non-mp-capable flow: sk is a tcp_sk,
- not an mptcp one.
@@ -91,7 +92,7 @@ static bool mptcp_is_tcpsk(struct sock *sk) sock->ops = &inet_stream_ops; return true; #if IS_ENABLED(CONFIG_MPTCP_IPV6)
- } else if (unlikely(sk->sk_prot == &tcpv6_prot)) {
- } else if (unlikely(family == AF_INET6)) {
These modifications here break MPTCP: this function (mptcp_is_tcpsk) is there to check if the socket is a "plain" TCP one (return "true") or an MPTCP one (return "false"). If it is not an MPTCP one, the sock ops is modified.
Here, you are saying: any IPv4 or IPv6 socket is a "plain" TCP one, never an MPTCP socket then.
I suggest adding ...
if (sk->sk_protocol == IPPROTO_MPTCP) return false;
... at the beginning of this function. I'm planning to send a patch later on including this check. Once it is sent, do you mind checking it with sockmap if you have the setup available, please?
Cheers, Matt