From 9f778b5678177a6ab3a2f62d2f6f55a2f120d4dc Mon Sep 17 00:00:00 2001 From: Quanye Yang Date: Sat, 26 Sep 2026 17:30:35 +0200 Subject: [PATCH] mptcp: split FASTCLOSE key from rcvr_key MP_CAPABLE and MP_FASTCLOSE both stored their key in rcvr_key. Give FASTCLOSE a dedicated fc_recv_key overlapped with rcvr_key in a union. This helps shrink struct mptcp_options_received. Signed-off-by: Quanye Yang Reviewed-by: Matthieu Baerts (NGI0) Signed-off-by: Matthieu Baerts (NGI0) Link: https://patch.msgid.link/20260926-net-next-mptcp-misc-feat-7-4-v1-2-67af4ab37406@kernel.org Signed-off-by: Jakub Kicinski --- net/mptcp/options.c | 6 +++--- net/mptcp/protocol.h | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/net/mptcp/options.c b/net/mptcp/options.c index ce0de02f5a3a..c2f4d7bd080c 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -374,10 +374,10 @@ static void mptcp_parse_option(const struct sk_buff *skb, break; ptr += 2; - mp_opt->rcvr_key = get_unaligned_be64(ptr); + mp_opt->fc_recv_key = get_unaligned_be64(ptr); ptr += 8; mp_opt->suboptions |= OPTION_MPTCP_FASTCLOSE; - pr_debug("MP_FASTCLOSE: recv_key=%llu\n", mp_opt->rcvr_key); + pr_debug("MP_FASTCLOSE: recv_key=%llu\n", mp_opt->fc_recv_key); break; case MPTCPOPT_RST: @@ -1258,7 +1258,7 @@ bool mptcp_incoming_options(struct sock *sk, struct sk_buff *skb) if (unlikely(mp_opt.suboptions != OPTION_MPTCP_DSS)) { if ((mp_opt.suboptions & OPTION_MPTCP_FASTCLOSE) && - READ_ONCE(msk->local_key) == mp_opt.rcvr_key) { + READ_ONCE(msk->local_key) == mp_opt.fc_recv_key) { WRITE_ONCE(msk->rcv_fastclose, true); mptcp_schedule_work((struct sock *)msk); MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_MPFASTCLOSERX); diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index dd9957d334b6..6b9bffc5992b 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -146,7 +146,10 @@ static inline bool before64(__u64 seq1, __u64 seq2) struct mptcp_options_received { u64 sndr_key; - u64 rcvr_key; + union { + u64 rcvr_key; + u64 fc_recv_key; + }; u64 data_ack; u64 data_seq; u32 subflow_seq;