Blame view
net/mptcp/protocol.h
14.3 KB
f870fa0b5
|
1 2 3 4 5 6 7 8 |
/* SPDX-License-Identifier: GPL-2.0 */ /* Multipath TCP * * Copyright (c) 2017 - 2019, Intel Corporation. */ #ifndef __MPTCP_PROTOCOL_H #define __MPTCP_PROTOCOL_H |
79c0949e9
|
9 10 11 |
#include <linux/random.h> #include <net/tcp.h> #include <net/inet_connection_sock.h> |
cc7972ea1
|
12 |
#define MPTCP_SUPPORTED_VERSION 1 |
eda7acddf
|
13 14 15 16 17 |
/* MPTCP option bits */ #define OPTION_MPTCP_MPC_SYN BIT(0) #define OPTION_MPTCP_MPC_SYNACK BIT(1) #define OPTION_MPTCP_MPC_ACK BIT(2) |
f296234c9
|
18 19 20 |
#define OPTION_MPTCP_MPJ_SYN BIT(3) #define OPTION_MPTCP_MPJ_SYNACK BIT(4) #define OPTION_MPTCP_MPJ_ACK BIT(5) |
3df523ab5
|
21 22 23 |
#define OPTION_MPTCP_ADD_ADDR BIT(6) #define OPTION_MPTCP_ADD_ADDR6 BIT(7) #define OPTION_MPTCP_RM_ADDR BIT(8) |
eda7acddf
|
24 25 26 27 28 29 30 31 32 33 34 35 |
/* MPTCP option subtypes */ #define MPTCPOPT_MP_CAPABLE 0 #define MPTCPOPT_MP_JOIN 1 #define MPTCPOPT_DSS 2 #define MPTCPOPT_ADD_ADDR 3 #define MPTCPOPT_RM_ADDR 4 #define MPTCPOPT_MP_PRIO 5 #define MPTCPOPT_MP_FAIL 6 #define MPTCPOPT_MP_FASTCLOSE 7 /* MPTCP suboption lengths */ |
cc7972ea1
|
36 |
#define TCPOLEN_MPTCP_MPC_SYN 4 |
eda7acddf
|
37 38 |
#define TCPOLEN_MPTCP_MPC_SYNACK 12 #define TCPOLEN_MPTCP_MPC_ACK 20 |
cc7972ea1
|
39 |
#define TCPOLEN_MPTCP_MPC_ACK_DATA 22 |
f296234c9
|
40 41 42 |
#define TCPOLEN_MPTCP_MPJ_SYN 12 #define TCPOLEN_MPTCP_MPJ_SYNACK 16 #define TCPOLEN_MPTCP_MPJ_ACK 24 |
6d0060f60
|
43 |
#define TCPOLEN_MPTCP_DSS_BASE 4 |
648ef4b88
|
44 |
#define TCPOLEN_MPTCP_DSS_ACK32 4 |
6d0060f60
|
45 |
#define TCPOLEN_MPTCP_DSS_ACK64 8 |
648ef4b88
|
46 |
#define TCPOLEN_MPTCP_DSS_MAP32 10 |
6d0060f60
|
47 48 |
#define TCPOLEN_MPTCP_DSS_MAP64 14 #define TCPOLEN_MPTCP_DSS_CHECKSUM 2 |
3df523ab5
|
49 50 51 52 53 54 55 56 57 58 |
#define TCPOLEN_MPTCP_ADD_ADDR 16 #define TCPOLEN_MPTCP_ADD_ADDR_PORT 18 #define TCPOLEN_MPTCP_ADD_ADDR_BASE 8 #define TCPOLEN_MPTCP_ADD_ADDR_BASE_PORT 10 #define TCPOLEN_MPTCP_ADD_ADDR6 28 #define TCPOLEN_MPTCP_ADD_ADDR6_PORT 30 #define TCPOLEN_MPTCP_ADD_ADDR6_BASE 20 #define TCPOLEN_MPTCP_ADD_ADDR6_BASE_PORT 22 #define TCPOLEN_MPTCP_PORT_LEN 2 #define TCPOLEN_MPTCP_RM_ADDR_BASE 4 |
eda7acddf
|
59 |
|
ec3edaa7c
|
60 |
/* MPTCP MP_JOIN flags */ |
f296234c9
|
61 62 |
#define MPTCPOPT_BACKUP BIT(0) #define MPTCPOPT_HMAC_LEN 20 |
ec3edaa7c
|
63 |
#define MPTCPOPT_THMAC_LEN 8 |
f296234c9
|
64 |
|
eda7acddf
|
65 66 67 68 |
/* MPTCP MP_CAPABLE flags */ #define MPTCP_VERSION_MASK (0x0F) #define MPTCP_CAP_CHECKSUM_REQD BIT(7) #define MPTCP_CAP_EXTENSIBILITY BIT(6) |
65492c5a6
|
69 |
#define MPTCP_CAP_HMAC_SHA256 BIT(0) |
eda7acddf
|
70 |
#define MPTCP_CAP_FLAG_MASK (0x3F) |
6d0060f60
|
71 72 73 74 75 76 |
/* MPTCP DSS flags */ #define MPTCP_DSS_DATA_FIN BIT(4) #define MPTCP_DSS_DSN64 BIT(3) #define MPTCP_DSS_HAS_MAP BIT(2) #define MPTCP_DSS_ACK64 BIT(1) #define MPTCP_DSS_HAS_ACK BIT(0) |
648ef4b88
|
77 |
#define MPTCP_DSS_FLAG_MASK (0x1F) |
3df523ab5
|
78 79 |
/* MPTCP ADD_ADDR flags */ #define MPTCP_ADDR_ECHO BIT(0) |
3df523ab5
|
80 81 |
#define MPTCP_ADDR_IPVERSION_4 4 #define MPTCP_ADDR_IPVERSION_6 6 |
648ef4b88
|
82 |
/* MPTCP socket flags */ |
d99bfed58
|
83 84 |
#define MPTCP_DATA_READY 0 #define MPTCP_SEND_SPACE 1 |
3b1d6210a
|
85 |
#define MPTCP_WORK_RTX 2 |
59832e246
|
86 |
#define MPTCP_WORK_EOF 3 |
e1ff9e82e
|
87 |
#define MPTCP_FALLBACK_DONE 4 |
6d0060f60
|
88 |
|
cfde141ea
|
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
struct mptcp_options_received { u64 sndr_key; u64 rcvr_key; u64 data_ack; u64 data_seq; u32 subflow_seq; u16 data_len; u16 mp_capable : 1, mp_join : 1, dss : 1, add_addr : 1, rm_addr : 1, family : 4, echo : 1, backup : 1; u32 token; u32 nonce; u64 thmac; u8 hmac[20]; u8 join_id; u8 use_map:1, dsn64:1, data_fin:1, use_ack:1, ack64:1, mpc_map:1, __unused:2; u8 addr_id; u8 rm_id; union { struct in_addr addr; #if IS_ENABLED(CONFIG_MPTCP_IPV6) struct in6_addr addr6; #endif }; u64 ahmac; u16 port; }; |
3df523ab5
|
127 128 129 130 131 |
static inline __be32 mptcp_option(u8 subopt, u8 len, u8 nib, u8 field) { return htonl((TCPOPT_MPTCP << 24) | (len << 16) | (subopt << 12) | ((nib & 0xF) << 8) | field); } |
1b1c7a0ef
|
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
struct mptcp_addr_info { sa_family_t family; __be16 port; u8 id; union { struct in_addr addr; #if IS_ENABLED(CONFIG_MPTCP_IPV6) struct in6_addr addr6; #endif }; }; enum mptcp_pm_status { MPTCP_PM_ADD_ADDR_RECEIVED, MPTCP_PM_ESTABLISHED, MPTCP_PM_SUBFLOW_ESTABLISHED, }; struct mptcp_pm_data { struct mptcp_addr_info local; struct mptcp_addr_info remote; spinlock_t lock; /*protects the whole PM data */ bool addr_signal; bool server_side; bool work_pending; bool accept_addr; bool accept_subflow; u8 add_addr_signaled; u8 add_addr_accepted; u8 local_addr_used; u8 subflows; u8 add_addr_signal_max; u8 add_addr_accept_max; u8 local_addr_max; u8 subflows_max; u8 status; |
1b1c7a0ef
|
170 |
}; |
18b683bff
|
171 172 173 174 175 176 177 178 |
struct mptcp_data_frag { struct list_head list; u64 data_seq; int data_len; int offset; int overhead; struct page *page; }; |
f870fa0b5
|
179 180 181 182 |
/* MPTCP connection sock */ struct mptcp_sock { /* inet_connection_sock must be the first member */ struct inet_connection_sock sk; |
cec37a6e4
|
183 184 |
u64 local_key; u64 remote_key; |
6d0060f60
|
185 186 |
u64 write_seq; u64 ack_seq; |
3721b9b64
|
187 |
u64 rcv_data_fin_seq; |
cc9d25669
|
188 |
atomic64_t snd_una; |
b51f9b80c
|
189 |
unsigned long timer_ival; |
79c0949e9
|
190 |
u32 token; |
648ef4b88
|
191 |
unsigned long flags; |
d22f4988f
|
192 |
bool can_ack; |
b93df08cc
|
193 |
bool fully_established; |
3721b9b64
|
194 |
bool rcv_data_fin; |
7279da614
|
195 |
bool snd_data_fin_enable; |
ec3edaa7c
|
196 |
spinlock_t join_list_lock; |
809920171
|
197 |
struct work_struct work; |
cec37a6e4
|
198 |
struct list_head conn_list; |
18b683bff
|
199 |
struct list_head rtx_queue; |
ec3edaa7c
|
200 |
struct list_head join_list; |
6d0060f60
|
201 |
struct skb_ext *cached_ext; /* for the next sendmsg */ |
f870fa0b5
|
202 |
struct socket *subflow; /* outgoing connect/listener/!mp_capable */ |
8ab183deb
|
203 |
struct sock *first; |
1b1c7a0ef
|
204 |
struct mptcp_pm_data pm; |
a6b118feb
|
205 206 207 208 209 210 |
struct { u32 space; /* bytes copied in last measurement window */ u32 copied; /* bytes copied in this measurement window */ u64 time; /* start time of measurement window */ u64 rtt_us; /* last maximum rtt of subflows */ } rcvq_space; |
f870fa0b5
|
211 |
}; |
cec37a6e4
|
212 213 |
#define mptcp_for_each_subflow(__msk, __subflow) \ list_for_each_entry(__subflow, &((__msk)->conn_list), node) |
f870fa0b5
|
214 215 216 217 |
static inline struct mptcp_sock *mptcp_sk(const struct sock *sk) { return (struct mptcp_sock *)sk; } |
18b683bff
|
218 219 220 221 222 223 224 225 226 |
static inline struct mptcp_data_frag *mptcp_rtx_tail(const struct sock *sk) { struct mptcp_sock *msk = mptcp_sk(sk); if (list_empty(&msk->rtx_queue)) return NULL; return list_last_entry(&msk->rtx_queue, struct mptcp_data_frag, list); } |
7948f6cc9
|
227 228 229 |
static inline struct mptcp_data_frag *mptcp_rtx_head(const struct sock *sk) { struct mptcp_sock *msk = mptcp_sk(sk); |
a386bc5b2
|
230 |
return list_first_entry_or_null(&msk->rtx_queue, struct mptcp_data_frag, list); |
7948f6cc9
|
231 |
} |
cec37a6e4
|
232 233 |
struct mptcp_subflow_request_sock { struct tcp_request_sock sk; |
d22f4988f
|
234 |
u16 mp_capable : 1, |
cec37a6e4
|
235 |
mp_join : 1, |
fca5c82c0
|
236 |
backup : 1; |
1b1c7a0ef
|
237 |
u8 local_id; |
f296234c9
|
238 |
u8 remote_id; |
cec37a6e4
|
239 |
u64 local_key; |
79c0949e9
|
240 241 |
u64 idsn; u32 token; |
648ef4b88
|
242 |
u32 ssn_offset; |
f296234c9
|
243 244 245 |
u64 thmac; u32 local_nonce; u32 remote_nonce; |
8fd4de127
|
246 |
struct mptcp_sock *msk; |
2c5ebd001
|
247 |
struct hlist_nulls_node token_node; |
cec37a6e4
|
248 249 250 251 252 253 254 |
}; static inline struct mptcp_subflow_request_sock * mptcp_subflow_rsk(const struct request_sock *rsk) { return (struct mptcp_subflow_request_sock *)rsk; } |
2303f994b
|
255 256 |
/* MPTCP subflow context */ struct mptcp_subflow_context { |
cec37a6e4
|
257 258 259 |
struct list_head node;/* conn_list of subflows */ u64 local_key; u64 remote_key; |
79c0949e9
|
260 |
u64 idsn; |
648ef4b88
|
261 |
u64 map_seq; |
cc7972ea1
|
262 |
u32 snd_isn; |
79c0949e9
|
263 |
u32 token; |
6d0060f60
|
264 |
u32 rel_write_seq; |
648ef4b88
|
265 266 267 |
u32 map_subflow_seq; u32 ssn_offset; u32 map_data_len; |
cec37a6e4
|
268 |
u32 request_mptcp : 1, /* send MP_CAPABLE */ |
ec3edaa7c
|
269 270 |
request_join : 1, /* send MP_JOIN */ request_bkup : 1, |
cec37a6e4
|
271 |
mp_capable : 1, /* remote is MPTCP capable */ |
f296234c9
|
272 |
mp_join : 1, /* remote is JOINing */ |
0be534f5c
|
273 |
fully_established : 1, /* path validated */ |
f296234c9
|
274 |
pm_notified : 1, /* PM hook called for established status */ |
648ef4b88
|
275 276 |
conn_finished : 1, map_valid : 1, |
d22f4988f
|
277 |
mpc_map : 1, |
f296234c9
|
278 |
backup : 1, |
648ef4b88
|
279 |
data_avail : 1, |
d22f4988f
|
280 |
rx_eof : 1, |
a0c1d0eaf
|
281 |
use_64bit_ack : 1, /* Set when we received a 64-bit DSN */ |
d22f4988f
|
282 |
can_ack : 1; /* only after processing the remote a key */ |
f296234c9
|
283 284 285 |
u32 remote_nonce; u64 thmac; u32 local_nonce; |
ec3edaa7c
|
286 287 |
u32 remote_token; u8 hmac[MPTCPOPT_HMAC_LEN]; |
f296234c9
|
288 289 |
u8 local_id; u8 remote_id; |
648ef4b88
|
290 |
|
2303f994b
|
291 292 |
struct sock *tcp_sock; /* tcp sk backpointer */ struct sock *conn; /* parent mptcp_sock */ |
cec37a6e4
|
293 |
const struct inet_connection_sock_af_ops *icsk_af_ops; |
648ef4b88
|
294 295 296 |
void (*tcp_data_ready)(struct sock *sk); void (*tcp_state_change)(struct sock *sk); void (*tcp_write_space)(struct sock *sk); |
2303f994b
|
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 |
struct rcu_head rcu; }; static inline struct mptcp_subflow_context * mptcp_subflow_ctx(const struct sock *sk) { struct inet_connection_sock *icsk = inet_csk(sk); /* Use RCU on icsk_ulp_data only for sock diag code */ return (__force struct mptcp_subflow_context *)icsk->icsk_ulp_data; } static inline struct sock * mptcp_subflow_tcp_sock(const struct mptcp_subflow_context *subflow) { return subflow->tcp_sock; } |
648ef4b88
|
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 |
static inline u64 mptcp_subflow_get_map_offset(const struct mptcp_subflow_context *subflow) { return tcp_sk(mptcp_subflow_tcp_sock(subflow))->copied_seq - subflow->ssn_offset - subflow->map_subflow_seq; } static inline u64 mptcp_subflow_get_mapped_dsn(const struct mptcp_subflow_context *subflow) { return subflow->map_seq + mptcp_subflow_get_map_offset(subflow); } int mptcp_is_enabled(struct net *net); |
b93df08cc
|
329 330 |
void mptcp_subflow_fully_established(struct mptcp_subflow_context *subflow, struct mptcp_options_received *mp_opt); |
648ef4b88
|
331 |
bool mptcp_subflow_data_available(struct sock *sk); |
d39dceca3
|
332 |
void __init mptcp_subflow_init(void); |
ec3edaa7c
|
333 334 335 336 337 |
/* called with sk socket lock held */ int __mptcp_subflow_connect(struct sock *sk, int ifindex, const struct mptcp_addr_info *loc, const struct mptcp_addr_info *remote); |
2303f994b
|
338 |
int mptcp_subflow_create_socket(struct sock *sk, struct socket **new_sock); |
648ef4b88
|
339 340 341 342 343 344 345 346 347 |
static inline void mptcp_subflow_tcp_fallback(struct sock *sk, struct mptcp_subflow_context *ctx) { sk->sk_data_ready = ctx->tcp_data_ready; sk->sk_state_change = ctx->tcp_state_change; sk->sk_write_space = ctx->tcp_write_space; inet_csk(sk)->icsk_af_ops = ctx->icsk_af_ops; } |
d39dceca3
|
348 |
void __init mptcp_proto_init(void); |
784325e9f
|
349 |
#if IS_ENABLED(CONFIG_MPTCP_IPV6) |
d39dceca3
|
350 |
int __init mptcp_proto_v6_init(void); |
784325e9f
|
351 |
#endif |
648ef4b88
|
352 |
|
fca5c82c0
|
353 |
struct sock *mptcp_sk_clone(const struct sock *sk, |
cfde141ea
|
354 |
const struct mptcp_options_received *mp_opt, |
fca5c82c0
|
355 |
struct request_sock *req); |
cec37a6e4
|
356 |
void mptcp_get_options(const struct sk_buff *skb, |
cfde141ea
|
357 |
struct mptcp_options_received *mp_opt); |
cec37a6e4
|
358 359 |
void mptcp_finish_connect(struct sock *sk); |
b93df08cc
|
360 361 362 363 364 |
static inline bool mptcp_is_fully_established(struct sock *sk) { return inet_sk_state_load(sk) == TCP_ESTABLISHED && READ_ONCE(mptcp_sk(sk)->fully_established); } |
a6b118feb
|
365 |
void mptcp_rcv_space_init(struct mptcp_sock *msk, const struct sock *ssk); |
2e52213c7
|
366 |
void mptcp_data_ready(struct sock *sk, struct sock *ssk); |
f296234c9
|
367 |
bool mptcp_finish_join(struct sock *sk); |
b51f9b80c
|
368 |
void mptcp_data_acked(struct sock *sk); |
59832e246
|
369 |
void mptcp_subflow_eof(struct sock *sk); |
3721b9b64
|
370 |
bool mptcp_update_rcv_data_fin(struct mptcp_sock *msk, u64 data_fin_seq); |
cec37a6e4
|
371 |
|
2c5ebd001
|
372 373 374 375 376 |
void __init mptcp_token_init(void); static inline void mptcp_token_init_request(struct request_sock *req) { mptcp_subflow_rsk(req)->token_node.pprev = NULL; } |
79c0949e9
|
377 |
int mptcp_token_new_request(struct request_sock *req); |
2c5ebd001
|
378 |
void mptcp_token_destroy_request(struct request_sock *req); |
79c0949e9
|
379 |
int mptcp_token_new_connect(struct sock *sk); |
2c5ebd001
|
380 381 |
void mptcp_token_accept(struct mptcp_subflow_request_sock *r, struct mptcp_sock *msk); |
c83a47e50
|
382 |
bool mptcp_token_exists(u32 token); |
f296234c9
|
383 |
struct mptcp_sock *mptcp_token_get_sock(u32 token); |
96d890daa
|
384 385 |
struct mptcp_sock *mptcp_token_iter_next(const struct net *net, long *s_slot, long *s_num); |
2c5ebd001
|
386 |
void mptcp_token_destroy(struct mptcp_sock *msk); |
79c0949e9
|
387 388 |
void mptcp_crypto_key_sha(u64 key, u32 *token, u64 *idsn); |
79c0949e9
|
389 |
|
3df523ab5
|
390 |
void mptcp_crypto_hmac_sha(u64 key1, u64 key2, u8 *msg, int len, void *hmac); |
79c0949e9
|
391 |
|
d39dceca3
|
392 |
void __init mptcp_pm_init(void); |
1b1c7a0ef
|
393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 |
void mptcp_pm_data_init(struct mptcp_sock *msk); void mptcp_pm_new_connection(struct mptcp_sock *msk, int server_side); void mptcp_pm_fully_established(struct mptcp_sock *msk); bool mptcp_pm_allow_new_subflow(struct mptcp_sock *msk); void mptcp_pm_connection_closed(struct mptcp_sock *msk); void mptcp_pm_subflow_established(struct mptcp_sock *msk, struct mptcp_subflow_context *subflow); void mptcp_pm_subflow_closed(struct mptcp_sock *msk, u8 id); void mptcp_pm_add_addr_received(struct mptcp_sock *msk, const struct mptcp_addr_info *addr); int mptcp_pm_announce_addr(struct mptcp_sock *msk, const struct mptcp_addr_info *addr); int mptcp_pm_remove_addr(struct mptcp_sock *msk, u8 local_id); int mptcp_pm_remove_subflow(struct mptcp_sock *msk, u8 remote_id); static inline bool mptcp_pm_should_signal(struct mptcp_sock *msk) { return READ_ONCE(msk->pm.addr_signal); } static inline unsigned int mptcp_add_addr_len(int family) { if (family == AF_INET) return TCPOLEN_MPTCP_ADD_ADDR; return TCPOLEN_MPTCP_ADD_ADDR6; } bool mptcp_pm_addr_signal(struct mptcp_sock *msk, unsigned int remaining, struct mptcp_addr_info *saddr); int mptcp_pm_get_local_id(struct mptcp_sock *msk, struct sock_common *skc); |
d39dceca3
|
424 |
void __init mptcp_pm_nl_init(void); |
01cacb00b
|
425 426 427 428 429 |
void mptcp_pm_nl_data_init(struct mptcp_sock *msk); void mptcp_pm_nl_fully_established(struct mptcp_sock *msk); void mptcp_pm_nl_subflow_established(struct mptcp_sock *msk); void mptcp_pm_nl_add_addr_received(struct mptcp_sock *msk); int mptcp_pm_nl_get_local_id(struct mptcp_sock *msk, struct sock_common *skc); |
6d0060f60
|
430 431 432 433 |
static inline struct mptcp_ext *mptcp_get_ext(struct sk_buff *skb) { return (struct mptcp_ext *)skb_ext_find(skb, SKB_EXT_MPTCP); } |
648ef4b88
|
434 435 436 437 438 439 |
static inline bool before64(__u64 seq1, __u64 seq2) { return (__s64)(seq1 - seq2) < 0; } #define after64(seq2, seq1) before64(seq1, seq2) |
5147dfb50
|
440 |
void mptcp_diag_subflow_init(struct tcp_ulp_ops *ops); |
e1ff9e82e
|
441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 |
static inline bool __mptcp_check_fallback(struct mptcp_sock *msk) { return test_bit(MPTCP_FALLBACK_DONE, &msk->flags); } static inline bool mptcp_check_fallback(struct sock *sk) { struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(sk); struct mptcp_sock *msk = mptcp_sk(subflow->conn); return __mptcp_check_fallback(msk); } static inline void __mptcp_do_fallback(struct mptcp_sock *msk) { if (test_bit(MPTCP_FALLBACK_DONE, &msk->flags)) { pr_debug("TCP fallback already done (msk=%p)", msk); return; } set_bit(MPTCP_FALLBACK_DONE, &msk->flags); } static inline void mptcp_do_fallback(struct sock *sk) { struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(sk); struct mptcp_sock *msk = mptcp_sk(subflow->conn); __mptcp_do_fallback(msk); } #define pr_fallback(a) pr_debug("%s:fallback to TCP (msk=%p)", __func__, a) |
8fd738049
|
472 473 474 475 476 477 478 479 480 |
static inline bool subflow_simultaneous_connect(struct sock *sk) { struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(sk); struct sock *parent = subflow->conn; return sk->sk_state == TCP_ESTABLISHED && !mptcp_sk(parent)->pm.server_side && !subflow->conn_finished; } |
9466a1cce
|
481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 |
#ifdef CONFIG_SYN_COOKIES void subflow_init_req_cookie_join_save(const struct mptcp_subflow_request_sock *subflow_req, struct sk_buff *skb); bool mptcp_token_join_cookie_init_state(struct mptcp_subflow_request_sock *subflow_req, struct sk_buff *skb); void __init mptcp_join_cookie_init(void); #else static inline void subflow_init_req_cookie_join_save(const struct mptcp_subflow_request_sock *subflow_req, struct sk_buff *skb) {} static inline bool mptcp_token_join_cookie_init_state(struct mptcp_subflow_request_sock *subflow_req, struct sk_buff *skb) { return false; } static inline void mptcp_join_cookie_init(void) {} #endif |
f870fa0b5
|
500 |
#endif /* __MPTCP_PROTOCOL_H */ |