File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -490,4 +490,14 @@ static inline void mptcp_do_fallback(struct sock *sk)
490490
491491#define pr_fallback (a ) pr_debug("%s:fallback to TCP (msk=%p)", __func__, a)
492492
493+ static inline bool subflow_simultaneous_connect (struct sock * sk )
494+ {
495+ struct mptcp_subflow_context * subflow = mptcp_subflow_ctx (sk );
496+ struct sock * parent = subflow -> conn ;
497+
498+ return sk -> sk_state == TCP_ESTABLISHED &&
499+ !mptcp_sk (parent )-> pm .server_side &&
500+ !subflow -> conn_finished ;
501+ }
502+
493503#endif /* __MPTCP_PROTOCOL_H */
Original file line number Diff line number Diff line change @@ -1128,6 +1128,16 @@ static void subflow_state_change(struct sock *sk)
11281128
11291129 __subflow_state_change (sk );
11301130
1131+ if (subflow_simultaneous_connect (sk )) {
1132+ mptcp_do_fallback (sk );
1133+ pr_fallback (mptcp_sk (parent ));
1134+ subflow -> conn_finished = 1 ;
1135+ if (inet_sk_state_load (parent ) == TCP_SYN_SENT ) {
1136+ inet_sk_state_store (parent , TCP_ESTABLISHED );
1137+ parent -> sk_state_change (parent );
1138+ }
1139+ }
1140+
11311141 /* as recvmsg() does not acquire the subflow socket for ssk selection
11321142 * a fin packet carrying a DSS can be unnoticed if we don't trigger
11331143 * the data available machinery here.
You can’t perform that action at this time.
0 commit comments