Unverified Commit f42049e3 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!8150 mptcp: use OPTION_MPTCP_MPJ_SYNACK in subflow_finish_connect()

parents 69bffe75 964bc277
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -113,6 +113,7 @@ static void mptcp_parse_option(const struct sk_buff *skb,
				 mp_opt->backup, mp_opt->join_id,
				 mp_opt->token, mp_opt->nonce);
		} else if (opsize == TCPOLEN_MPTCP_MPJ_SYNACK) {
			mp_opt->suboptions |= OPTION_MPTCP_MPJ_SYNACK;
			mp_opt->backup = *ptr++ & MPTCPOPT_BACKUP;
			mp_opt->join_id = *ptr++;
			mp_opt->thmac = get_unaligned_be64(ptr);
@@ -299,6 +300,7 @@ void mptcp_get_options(const struct sk_buff *skb,
	mp_opt->port = 0;
	mp_opt->rm_addr = 0;
	mp_opt->dss = 0;
	mp_opt->suboptions = 0;

	length = (th->doff * 4) - sizeof(struct tcphdr);
	ptr = (const unsigned char *)(th + 1);
+1 −0
Original line number Diff line number Diff line
@@ -107,6 +107,7 @@ struct mptcp_options_received {
		family : 4,
		echo : 1,
		backup : 1;
	u16	suboptions;
	u32	token;
	u32	nonce;
	u64	thmac;
+2 −1
Original line number Diff line number Diff line
@@ -323,7 +323,7 @@ static void subflow_finish_connect(struct sock *sk, const struct sk_buff *skb)
	} else if (subflow->request_join) {
		u8 hmac[SHA256_DIGEST_SIZE];

		if (!mp_opt.mp_join)
		if (!(mp_opt.suboptions & OPTION_MPTCP_MPJ_SYNACK))
			goto do_reset;

		subflow->thmac = mp_opt.thmac;
@@ -542,6 +542,7 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk,
	 * are not parsed
	 */
	mp_opt.mp_capable = 0;
	mp_opt.suboptions = 0;

	/* hopefully temporary handling for MP_JOIN+syncookie */
	subflow_req = mptcp_subflow_rsk(req);