[PATCH net-next 2/5] mptcp: split FASTCLOSE key from rcvr_key

From: Matthieu Baerts (NGI0)

Date: Sat Sep 26 2026 - 11:33:03 EST


From: Quanye Yang <quanyeyang@xxxxxxxxx>

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 <quanyeyang@xxxxxxxxx>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@xxxxxxxxxx>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@xxxxxxxxxx>
---
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;

--
2.55.0