History

mptcp: Handle MPTCP TCP options

Add hooks to parse and format the MP_CAPABLE option. This option is handled according to MPTCP version 0 (RFC6824). MPTCP version 1 MP_CAPABLE (RFC6824bis/RFC8684) will be added later in coordination with related code changes.

Peter Krystad committed 6 years ago

Commit eda7acd1 parent f870fa07 files · +181 −1Browse files

Showing the changes to include/linux (1 of 7 files). Show all

Unified · Split

include/linux/tcp.h+18−0
@@ -78,6 +78,16 @@ struct tcp_sack_block { · 77 unmodified lines
7878 #define TCP_SACK_SEEN (1 << 0) /*1 = peer is SACK capable, */
7979 #define TCP_DSACK_SEEN (1 << 2) /*1 = DSACK was received from peer*/
8080
81+#if IS_ENABLED(CONFIG_MPTCP)
82+struct mptcp_options_received {
83+ u64 sndr_key;
84+ u64 rcvr_key;
85+ u8 mp_capable : 1,
86+ mp_join : 1,
87+ dss : 1;
88+};
89+#endif
90+
8191 struct tcp_options_received {
8292 /* PAWS/RTTM data */
8393 int ts_recent_stamp;/* Time we stored ts_recent (for aging) */
@@ -95,6 +105,9 @@ struct tcp_options_received { · 11 unmodified lines
95105 u8 num_sacks; /* Number of SACK blocks */
96106 u16 user_mss; /* mss requested by user in ioctl */
97107 u16 mss_clamp; /* Maximal mss, negotiated at connection setup */
108+#if IS_ENABLED(CONFIG_MPTCP)
109+ struct mptcp_options_received mptcp;
110+#endif
98111 };
99112
100113 static inline void tcp_clear_options(struct tcp_options_received *rx_opt)
@@ -104,6 +117,11 @@ static inline void tcp_clear_options(struct tcp_options_received *rx_opt) · 3 unmodified lines
104117 #if IS_ENABLED(CONFIG_SMC)
105118 rx_opt->smc_ok = 0;
106119 #endif
120+#if IS_ENABLED(CONFIG_MPTCP)
121+ rx_opt->mptcp.mp_capable = 0;
122+ rx_opt->mptcp.mp_join = 0;
123+ rx_opt->mptcp.dss = 0;
124+#endif
107125 }
108126
109127 /* This is the max number of SACKS that we'll generate and process. It's safe