1 /* SPDX-License-Identifier: GPL-2.0 */
4 * Copyright (c) 2017 - 2019, Intel Corporation.
7 #ifndef __MPTCP_PROTOCOL_H
8 #define __MPTCP_PROTOCOL_H
10 #include <linux/random.h>
12 #include <net/inet_connection_sock.h>
14 #define MPTCP_SUPPORTED_VERSION 1
16 /* MPTCP option bits */
17 #define OPTION_MPTCP_MPC_SYN BIT(0)
18 #define OPTION_MPTCP_MPC_SYNACK BIT(1)
19 #define OPTION_MPTCP_MPC_ACK BIT(2)
20 #define OPTION_MPTCP_MPJ_SYN BIT(3)
21 #define OPTION_MPTCP_MPJ_SYNACK BIT(4)
22 #define OPTION_MPTCP_MPJ_ACK BIT(5)
23 #define OPTION_MPTCP_ADD_ADDR BIT(6)
24 #define OPTION_MPTCP_ADD_ADDR6 BIT(7)
25 #define OPTION_MPTCP_RM_ADDR BIT(8)
26 #define OPTION_MPTCP_FASTCLOSE BIT(9)
28 /* MPTCP option subtypes */
29 #define MPTCPOPT_MP_CAPABLE 0
30 #define MPTCPOPT_MP_JOIN 1
31 #define MPTCPOPT_DSS 2
32 #define MPTCPOPT_ADD_ADDR 3
33 #define MPTCPOPT_RM_ADDR 4
34 #define MPTCPOPT_MP_PRIO 5
35 #define MPTCPOPT_MP_FAIL 6
36 #define MPTCPOPT_MP_FASTCLOSE 7
38 /* MPTCP suboption lengths */
39 #define TCPOLEN_MPTCP_MPC_SYN 4
40 #define TCPOLEN_MPTCP_MPC_SYNACK 12
41 #define TCPOLEN_MPTCP_MPC_ACK 20
42 #define TCPOLEN_MPTCP_MPC_ACK_DATA 22
43 #define TCPOLEN_MPTCP_MPJ_SYN 12
44 #define TCPOLEN_MPTCP_MPJ_SYNACK 16
45 #define TCPOLEN_MPTCP_MPJ_ACK 24
46 #define TCPOLEN_MPTCP_DSS_BASE 4
47 #define TCPOLEN_MPTCP_DSS_ACK32 4
48 #define TCPOLEN_MPTCP_DSS_ACK64 8
49 #define TCPOLEN_MPTCP_DSS_MAP32 10
50 #define TCPOLEN_MPTCP_DSS_MAP64 14
51 #define TCPOLEN_MPTCP_DSS_CHECKSUM 2
52 #define TCPOLEN_MPTCP_ADD_ADDR 16
53 #define TCPOLEN_MPTCP_ADD_ADDR_PORT 20
54 #define TCPOLEN_MPTCP_ADD_ADDR_BASE 8
55 #define TCPOLEN_MPTCP_ADD_ADDR_BASE_PORT 12
56 #define TCPOLEN_MPTCP_ADD_ADDR6 28
57 #define TCPOLEN_MPTCP_ADD_ADDR6_PORT 32
58 #define TCPOLEN_MPTCP_ADD_ADDR6_BASE 20
59 #define TCPOLEN_MPTCP_ADD_ADDR6_BASE_PORT 24
60 #define TCPOLEN_MPTCP_PORT_LEN 4
61 #define TCPOLEN_MPTCP_RM_ADDR_BASE 4
62 #define TCPOLEN_MPTCP_FASTCLOSE 12
64 /* MPTCP MP_JOIN flags */
65 #define MPTCPOPT_BACKUP BIT(0)
66 #define MPTCPOPT_HMAC_LEN 20
67 #define MPTCPOPT_THMAC_LEN 8
69 /* MPTCP MP_CAPABLE flags */
70 #define MPTCP_VERSION_MASK (0x0F)
71 #define MPTCP_CAP_CHECKSUM_REQD BIT(7)
72 #define MPTCP_CAP_EXTENSIBILITY BIT(6)
73 #define MPTCP_CAP_HMAC_SHA256 BIT(0)
74 #define MPTCP_CAP_FLAG_MASK (0x3F)
77 #define MPTCP_DSS_DATA_FIN BIT(4)
78 #define MPTCP_DSS_DSN64 BIT(3)
79 #define MPTCP_DSS_HAS_MAP BIT(2)
80 #define MPTCP_DSS_ACK64 BIT(1)
81 #define MPTCP_DSS_HAS_ACK BIT(0)
82 #define MPTCP_DSS_FLAG_MASK (0x1F)
84 /* MPTCP ADD_ADDR flags */
85 #define MPTCP_ADDR_ECHO BIT(0)
86 #define MPTCP_ADDR_IPVERSION_4 4
87 #define MPTCP_ADDR_IPVERSION_6 6
89 /* MPTCP socket flags */
90 #define MPTCP_DATA_READY 0
91 #define MPTCP_NOSPACE 1
92 #define MPTCP_WORK_RTX 2
93 #define MPTCP_WORK_EOF 3
94 #define MPTCP_FALLBACK_DONE 4
95 #define MPTCP_WORK_CLOSE_SUBFLOW 5
96 #define MPTCP_PUSH_PENDING 6
97 #define MPTCP_CLEAN_UNA 7
99 static inline bool before64(__u64 seq1
, __u64 seq2
)
101 return (__s64
)(seq1
- seq2
) < 0;
104 #define after64(seq2, seq1) before64(seq1, seq2)
106 struct mptcp_options_received
{
125 u8 hmac
[MPTCPOPT_HMAC_LEN
];
138 #if IS_ENABLED(CONFIG_MPTCP_IPV6)
139 struct in6_addr addr6
;
146 static inline __be32
mptcp_option(u8 subopt
, u8 len
, u8 nib
, u8 field
)
148 return htonl((TCPOPT_MPTCP
<< 24) | (len
<< 16) | (subopt
<< 12) |
149 ((nib
& 0xF) << 8) | field
);
152 struct mptcp_addr_info
{
160 #if IS_ENABLED(CONFIG_MPTCP_IPV6)
161 struct in6_addr addr6
;
166 enum mptcp_pm_status
{
167 MPTCP_PM_ADD_ADDR_RECEIVED
,
168 MPTCP_PM_ADD_ADDR_SEND_ACK
,
169 MPTCP_PM_RM_ADDR_RECEIVED
,
170 MPTCP_PM_ESTABLISHED
,
171 MPTCP_PM_ALREADY_ESTABLISHED
, /* persistent status, set after ESTABLISHED event */
172 MPTCP_PM_SUBFLOW_ESTABLISHED
,
175 enum mptcp_addr_signal_status
{
176 MPTCP_ADD_ADDR_SIGNAL
,
180 MPTCP_RM_ADDR_SIGNAL
,
183 struct mptcp_pm_data
{
184 struct mptcp_addr_info local
;
185 struct mptcp_addr_info remote
;
186 struct list_head anno_list
;
188 spinlock_t lock
; /*protects the whole PM data */
195 u8 add_addr_signaled
;
196 u8 add_addr_accepted
;
199 u8 add_addr_signal_max
;
200 u8 add_addr_accept_max
;
207 struct mptcp_data_frag
{
208 struct list_head list
;
217 /* MPTCP connection sock */
219 /* inet_connection_sock must be the first member */
220 struct inet_connection_sock sk
;
227 u64 rcv_data_fin_seq
;
229 struct sock
*last_snd
;
234 unsigned long timer_ival
;
240 bool fully_established
;
242 bool snd_data_fin_enable
;
244 bool use_64bit_ack
; /* Set when we received a 64-bit DSN */
245 spinlock_t join_list_lock
;
246 struct sock
*ack_hint
;
247 struct work_struct work
;
248 struct sk_buff
*ooo_last_skb
;
249 struct rb_root out_of_order_queue
;
250 struct sk_buff_head receive_queue
;
251 struct sk_buff_head skb_tx_cache
; /* this is wmem accounted */
254 struct list_head conn_list
;
255 struct list_head rtx_queue
;
256 struct mptcp_data_frag
*first_pending
;
257 struct list_head join_list
;
258 struct socket
*subflow
; /* outgoing connect/listener/!mp_capable */
260 struct mptcp_pm_data pm
;
262 u32 space
; /* bytes copied in last measurement window */
263 u32 copied
; /* bytes copied in this measurement window */
264 u64 time
; /* start time of measurement window */
265 u64 rtt_us
; /* last maximum rtt of subflows */
269 #define mptcp_lock_sock(___sk, cb) do { \
270 struct sock *__sk = (___sk); /* silence macro reuse warning */ \
272 spin_lock_bh(&__sk->sk_lock.slock); \
273 if (__sk->sk_lock.owned) \
276 __sk->sk_lock.owned = 1; \
277 spin_unlock(&__sk->sk_lock.slock); \
278 mutex_acquire(&__sk->sk_lock.dep_map, 0, 0, _RET_IP_); \
282 #define mptcp_data_lock(sk) spin_lock_bh(&(sk)->sk_lock.slock)
283 #define mptcp_data_unlock(sk) spin_unlock_bh(&(sk)->sk_lock.slock)
285 #define mptcp_for_each_subflow(__msk, __subflow) \
286 list_for_each_entry(__subflow, &((__msk)->conn_list), node)
288 static inline struct mptcp_sock
*mptcp_sk(const struct sock
*sk
)
290 return (struct mptcp_sock
*)sk
;
293 static inline int __mptcp_space(const struct sock
*sk
)
295 return tcp_space(sk
) + READ_ONCE(mptcp_sk(sk
)->rmem_pending
);
298 static inline struct mptcp_data_frag
*mptcp_send_head(const struct sock
*sk
)
300 const struct mptcp_sock
*msk
= mptcp_sk(sk
);
302 return READ_ONCE(msk
->first_pending
);
305 static inline struct mptcp_data_frag
*mptcp_send_next(struct sock
*sk
)
307 struct mptcp_sock
*msk
= mptcp_sk(sk
);
308 struct mptcp_data_frag
*cur
;
310 cur
= msk
->first_pending
;
311 return list_is_last(&cur
->list
, &msk
->rtx_queue
) ? NULL
:
312 list_next_entry(cur
, list
);
315 static inline struct mptcp_data_frag
*mptcp_pending_tail(const struct sock
*sk
)
317 struct mptcp_sock
*msk
= mptcp_sk(sk
);
319 if (!msk
->first_pending
)
322 if (WARN_ON_ONCE(list_empty(&msk
->rtx_queue
)))
325 return list_last_entry(&msk
->rtx_queue
, struct mptcp_data_frag
, list
);
328 static inline struct mptcp_data_frag
*mptcp_rtx_tail(const struct sock
*sk
)
330 struct mptcp_sock
*msk
= mptcp_sk(sk
);
332 if (!before64(msk
->snd_nxt
, READ_ONCE(msk
->snd_una
)))
335 return list_last_entry(&msk
->rtx_queue
, struct mptcp_data_frag
, list
);
338 static inline struct mptcp_data_frag
*mptcp_rtx_head(const struct sock
*sk
)
340 struct mptcp_sock
*msk
= mptcp_sk(sk
);
342 return list_first_entry_or_null(&msk
->rtx_queue
, struct mptcp_data_frag
, list
);
345 struct mptcp_subflow_request_sock
{
346 struct tcp_request_sock sk
;
359 struct mptcp_sock
*msk
;
360 struct hlist_nulls_node token_node
;
363 static inline struct mptcp_subflow_request_sock
*
364 mptcp_subflow_rsk(const struct request_sock
*rsk
)
366 return (struct mptcp_subflow_request_sock
*)rsk
;
369 enum mptcp_data_avail
{
370 MPTCP_SUBFLOW_NODATA
,
371 MPTCP_SUBFLOW_DATA_AVAIL
,
372 MPTCP_SUBFLOW_OOO_DATA
375 /* MPTCP subflow context */
376 struct mptcp_subflow_context
{
377 struct list_head node
;/* conn_list of subflows */
388 u32 request_mptcp
: 1, /* send MP_CAPABLE */
389 request_join
: 1, /* send MP_JOIN */
391 mp_capable
: 1, /* remote is MPTCP capable */
392 mp_join
: 1, /* remote is JOINing */
393 fully_established
: 1, /* path validated */
394 pm_notified
: 1, /* PM hook called for established status */
400 can_ack
: 1, /* only after processing the remote a key */
401 disposable
: 1; /* ctx can be free at ulp release time */
402 enum mptcp_data_avail data_avail
;
407 u8 hmac
[MPTCPOPT_HMAC_LEN
];
411 struct sock
*tcp_sock
; /* tcp sk backpointer */
412 struct sock
*conn
; /* parent mptcp_sock */
413 const struct inet_connection_sock_af_ops
*icsk_af_ops
;
414 void (*tcp_data_ready
)(struct sock
*sk
);
415 void (*tcp_state_change
)(struct sock
*sk
);
416 void (*tcp_write_space
)(struct sock
*sk
);
421 static inline struct mptcp_subflow_context
*
422 mptcp_subflow_ctx(const struct sock
*sk
)
424 struct inet_connection_sock
*icsk
= inet_csk(sk
);
426 /* Use RCU on icsk_ulp_data only for sock diag code */
427 return (__force
struct mptcp_subflow_context
*)icsk
->icsk_ulp_data
;
430 static inline struct sock
*
431 mptcp_subflow_tcp_sock(const struct mptcp_subflow_context
*subflow
)
433 return subflow
->tcp_sock
;
437 mptcp_subflow_get_map_offset(const struct mptcp_subflow_context
*subflow
)
439 return tcp_sk(mptcp_subflow_tcp_sock(subflow
))->copied_seq
-
440 subflow
->ssn_offset
-
441 subflow
->map_subflow_seq
;
445 mptcp_subflow_get_mapped_dsn(const struct mptcp_subflow_context
*subflow
)
447 return subflow
->map_seq
+ mptcp_subflow_get_map_offset(subflow
);
450 static inline void mptcp_add_pending_subflow(struct mptcp_sock
*msk
,
451 struct mptcp_subflow_context
*subflow
)
453 sock_hold(mptcp_subflow_tcp_sock(subflow
));
454 spin_lock_bh(&msk
->join_list_lock
);
455 list_add_tail(&subflow
->node
, &msk
->join_list
);
456 spin_unlock_bh(&msk
->join_list_lock
);
459 int mptcp_is_enabled(struct net
*net
);
460 unsigned int mptcp_get_add_addr_timeout(struct net
*net
);
461 void mptcp_subflow_fully_established(struct mptcp_subflow_context
*subflow
,
462 struct mptcp_options_received
*mp_opt
);
463 bool mptcp_subflow_data_available(struct sock
*sk
);
464 void __init
mptcp_subflow_init(void);
465 void mptcp_subflow_shutdown(struct sock
*sk
, struct sock
*ssk
, int how
);
466 void __mptcp_close_ssk(struct sock
*sk
, struct sock
*ssk
,
467 struct mptcp_subflow_context
*subflow
);
468 void mptcp_subflow_reset(struct sock
*ssk
);
470 /* called with sk socket lock held */
471 int __mptcp_subflow_connect(struct sock
*sk
, const struct mptcp_addr_info
*loc
,
472 const struct mptcp_addr_info
*remote
);
473 int mptcp_subflow_create_socket(struct sock
*sk
, struct socket
**new_sock
);
475 static inline void mptcp_subflow_tcp_fallback(struct sock
*sk
,
476 struct mptcp_subflow_context
*ctx
)
478 sk
->sk_data_ready
= ctx
->tcp_data_ready
;
479 sk
->sk_state_change
= ctx
->tcp_state_change
;
480 sk
->sk_write_space
= ctx
->tcp_write_space
;
482 inet_csk(sk
)->icsk_af_ops
= ctx
->icsk_af_ops
;
485 void __init
mptcp_proto_init(void);
486 #if IS_ENABLED(CONFIG_MPTCP_IPV6)
487 int __init
mptcp_proto_v6_init(void);
490 struct sock
*mptcp_sk_clone(const struct sock
*sk
,
491 const struct mptcp_options_received
*mp_opt
,
492 struct request_sock
*req
);
493 void mptcp_get_options(const struct sk_buff
*skb
,
494 struct mptcp_options_received
*mp_opt
);
496 void mptcp_finish_connect(struct sock
*sk
);
497 static inline bool mptcp_is_fully_established(struct sock
*sk
)
499 return inet_sk_state_load(sk
) == TCP_ESTABLISHED
&&
500 READ_ONCE(mptcp_sk(sk
)->fully_established
);
502 void mptcp_rcv_space_init(struct mptcp_sock
*msk
, const struct sock
*ssk
);
503 void mptcp_data_ready(struct sock
*sk
, struct sock
*ssk
);
504 bool mptcp_finish_join(struct sock
*sk
);
505 bool mptcp_schedule_work(struct sock
*sk
);
506 void __mptcp_check_push(struct sock
*sk
, struct sock
*ssk
);
507 void __mptcp_data_acked(struct sock
*sk
);
508 void mptcp_subflow_eof(struct sock
*sk
);
509 bool mptcp_update_rcv_data_fin(struct mptcp_sock
*msk
, u64 data_fin_seq
, bool use_64bit
);
510 void __mptcp_flush_join_list(struct mptcp_sock
*msk
);
511 static inline bool mptcp_data_fin_enabled(const struct mptcp_sock
*msk
)
513 return READ_ONCE(msk
->snd_data_fin_enable
) &&
514 READ_ONCE(msk
->write_seq
) == READ_ONCE(msk
->snd_nxt
);
517 void mptcp_destroy_common(struct mptcp_sock
*msk
);
519 void __init
mptcp_token_init(void);
520 static inline void mptcp_token_init_request(struct request_sock
*req
)
522 mptcp_subflow_rsk(req
)->token_node
.pprev
= NULL
;
525 int mptcp_token_new_request(struct request_sock
*req
);
526 void mptcp_token_destroy_request(struct request_sock
*req
);
527 int mptcp_token_new_connect(struct sock
*sk
);
528 void mptcp_token_accept(struct mptcp_subflow_request_sock
*r
,
529 struct mptcp_sock
*msk
);
530 bool mptcp_token_exists(u32 token
);
531 struct mptcp_sock
*mptcp_token_get_sock(u32 token
);
532 struct mptcp_sock
*mptcp_token_iter_next(const struct net
*net
, long *s_slot
,
534 void mptcp_token_destroy(struct mptcp_sock
*msk
);
536 void mptcp_crypto_key_sha(u64 key
, u32
*token
, u64
*idsn
);
538 void mptcp_crypto_hmac_sha(u64 key1
, u64 key2
, u8
*msg
, int len
, void *hmac
);
540 void __init
mptcp_pm_init(void);
541 void mptcp_pm_data_init(struct mptcp_sock
*msk
);
542 void mptcp_pm_new_connection(struct mptcp_sock
*msk
, int server_side
);
543 void mptcp_pm_fully_established(struct mptcp_sock
*msk
);
544 bool mptcp_pm_allow_new_subflow(struct mptcp_sock
*msk
);
545 void mptcp_pm_connection_closed(struct mptcp_sock
*msk
);
546 void mptcp_pm_subflow_established(struct mptcp_sock
*msk
,
547 struct mptcp_subflow_context
*subflow
);
548 void mptcp_pm_subflow_closed(struct mptcp_sock
*msk
, u8 id
);
549 void mptcp_pm_add_addr_received(struct mptcp_sock
*msk
,
550 const struct mptcp_addr_info
*addr
);
551 void mptcp_pm_add_addr_send_ack(struct mptcp_sock
*msk
);
552 void mptcp_pm_rm_addr_received(struct mptcp_sock
*msk
, u8 rm_id
);
553 void mptcp_pm_free_anno_list(struct mptcp_sock
*msk
);
554 struct mptcp_pm_add_entry
*
555 mptcp_pm_del_add_timer(struct mptcp_sock
*msk
,
556 struct mptcp_addr_info
*addr
);
558 int mptcp_pm_announce_addr(struct mptcp_sock
*msk
,
559 const struct mptcp_addr_info
*addr
,
560 bool echo
, bool port
);
561 int mptcp_pm_remove_addr(struct mptcp_sock
*msk
, u8 local_id
);
562 int mptcp_pm_remove_subflow(struct mptcp_sock
*msk
, u8 local_id
);
564 static inline bool mptcp_pm_should_add_signal(struct mptcp_sock
*msk
)
566 return READ_ONCE(msk
->pm
.addr_signal
) & BIT(MPTCP_ADD_ADDR_SIGNAL
);
569 static inline bool mptcp_pm_should_add_signal_echo(struct mptcp_sock
*msk
)
571 return READ_ONCE(msk
->pm
.addr_signal
) & BIT(MPTCP_ADD_ADDR_ECHO
);
574 static inline bool mptcp_pm_should_add_signal_ipv6(struct mptcp_sock
*msk
)
576 return READ_ONCE(msk
->pm
.addr_signal
) & BIT(MPTCP_ADD_ADDR_IPV6
);
579 static inline bool mptcp_pm_should_add_signal_port(struct mptcp_sock
*msk
)
581 return READ_ONCE(msk
->pm
.addr_signal
) & BIT(MPTCP_ADD_ADDR_PORT
);
584 static inline bool mptcp_pm_should_rm_signal(struct mptcp_sock
*msk
)
586 return READ_ONCE(msk
->pm
.addr_signal
) & BIT(MPTCP_RM_ADDR_SIGNAL
);
589 static inline unsigned int mptcp_add_addr_len(int family
, bool echo
, bool port
)
591 u8 len
= TCPOLEN_MPTCP_ADD_ADDR_BASE
;
593 if (family
== AF_INET6
)
594 len
= TCPOLEN_MPTCP_ADD_ADDR6_BASE
;
596 len
+= MPTCPOPT_THMAC_LEN
;
598 len
+= TCPOLEN_MPTCP_PORT_LEN
;
603 bool mptcp_pm_add_addr_signal(struct mptcp_sock
*msk
, unsigned int remaining
,
604 struct mptcp_addr_info
*saddr
, bool *echo
, bool *port
);
605 bool mptcp_pm_rm_addr_signal(struct mptcp_sock
*msk
, unsigned int remaining
,
607 int mptcp_pm_get_local_id(struct mptcp_sock
*msk
, struct sock_common
*skc
);
609 void __init
mptcp_pm_nl_init(void);
610 void mptcp_pm_nl_data_init(struct mptcp_sock
*msk
);
611 void mptcp_pm_nl_fully_established(struct mptcp_sock
*msk
);
612 void mptcp_pm_nl_subflow_established(struct mptcp_sock
*msk
);
613 void mptcp_pm_nl_add_addr_received(struct mptcp_sock
*msk
);
614 void mptcp_pm_nl_add_addr_send_ack(struct mptcp_sock
*msk
);
615 void mptcp_pm_nl_rm_addr_received(struct mptcp_sock
*msk
);
616 void mptcp_pm_nl_rm_subflow_received(struct mptcp_sock
*msk
, u8 rm_id
);
617 int mptcp_pm_nl_get_local_id(struct mptcp_sock
*msk
, struct sock_common
*skc
);
619 static inline struct mptcp_ext
*mptcp_get_ext(struct sk_buff
*skb
)
621 return (struct mptcp_ext
*)skb_ext_find(skb
, SKB_EXT_MPTCP
);
624 void mptcp_diag_subflow_init(struct tcp_ulp_ops
*ops
);
626 static inline bool __mptcp_check_fallback(const struct mptcp_sock
*msk
)
628 return test_bit(MPTCP_FALLBACK_DONE
, &msk
->flags
);
631 static inline bool mptcp_check_fallback(const struct sock
*sk
)
633 struct mptcp_subflow_context
*subflow
= mptcp_subflow_ctx(sk
);
634 struct mptcp_sock
*msk
= mptcp_sk(subflow
->conn
);
636 return __mptcp_check_fallback(msk
);
639 static inline void __mptcp_do_fallback(struct mptcp_sock
*msk
)
641 if (test_bit(MPTCP_FALLBACK_DONE
, &msk
->flags
)) {
642 pr_debug("TCP fallback already done (msk=%p)", msk
);
645 set_bit(MPTCP_FALLBACK_DONE
, &msk
->flags
);
648 static inline void mptcp_do_fallback(struct sock
*sk
)
650 struct mptcp_subflow_context
*subflow
= mptcp_subflow_ctx(sk
);
651 struct mptcp_sock
*msk
= mptcp_sk(subflow
->conn
);
653 __mptcp_do_fallback(msk
);
656 #define pr_fallback(a) pr_debug("%s:fallback to TCP (msk=%p)", __func__, a)
658 static inline bool subflow_simultaneous_connect(struct sock
*sk
)
660 struct mptcp_subflow_context
*subflow
= mptcp_subflow_ctx(sk
);
661 struct sock
*parent
= subflow
->conn
;
663 return sk
->sk_state
== TCP_ESTABLISHED
&&
664 !mptcp_sk(parent
)->pm
.server_side
&&
665 !subflow
->conn_finished
;
668 #ifdef CONFIG_SYN_COOKIES
669 void subflow_init_req_cookie_join_save(const struct mptcp_subflow_request_sock
*subflow_req
,
670 struct sk_buff
*skb
);
671 bool mptcp_token_join_cookie_init_state(struct mptcp_subflow_request_sock
*subflow_req
,
672 struct sk_buff
*skb
);
673 void __init
mptcp_join_cookie_init(void);
676 subflow_init_req_cookie_join_save(const struct mptcp_subflow_request_sock
*subflow_req
,
677 struct sk_buff
*skb
) {}
679 mptcp_token_join_cookie_init_state(struct mptcp_subflow_request_sock
*subflow_req
,
685 static inline void mptcp_join_cookie_init(void) {}
688 #endif /* __MPTCP_PROTOCOL_H */