mptcp: add allow_join_id0 in mptcp_out_options
This patch defined a new flag MPTCP_CAP_DENY_JOIN_ID0 for the third bit, labeled "C" of the MP_CAPABLE option. Add a new flag allow_join_id0 in struct mptcp_out_options. If this flag is set, send out the MP_CAPABLE option with the flag MPTCP_CAP_DENY_JOIN_ID0. Acked-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Geliang Tang <geliangtang@gmail.com> Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
d2f77960e5
commit
bab6b88e05
@@ -402,6 +402,7 @@ bool mptcp_syn_options(struct sock *sk, const struct sk_buff *skb,
|
||||
if (subflow->request_mptcp) {
|
||||
opts->suboptions = OPTION_MPTCP_MPC_SYN;
|
||||
opts->csum_reqd = mptcp_is_checksum_enabled(sock_net(sk));
|
||||
opts->allow_join_id0 = mptcp_allow_join_id0(sock_net(sk));
|
||||
*size = TCPOLEN_MPTCP_MPC_SYN;
|
||||
return true;
|
||||
} else if (subflow->request_join) {
|
||||
@@ -490,6 +491,7 @@ static bool mptcp_established_options_mp(struct sock *sk, struct sk_buff *skb,
|
||||
opts->sndr_key = subflow->local_key;
|
||||
opts->rcvr_key = subflow->remote_key;
|
||||
opts->csum_reqd = READ_ONCE(msk->csum_enabled);
|
||||
opts->allow_join_id0 = mptcp_allow_join_id0(sock_net(sk));
|
||||
|
||||
/* Section 3.1.
|
||||
* The MP_CAPABLE option is carried on the SYN, SYN/ACK, and ACK
|
||||
@@ -827,6 +829,7 @@ bool mptcp_synack_options(const struct request_sock *req, unsigned int *size,
|
||||
opts->suboptions = OPTION_MPTCP_MPC_SYNACK;
|
||||
opts->sndr_key = subflow_req->local_key;
|
||||
opts->csum_reqd = subflow_req->csum_reqd;
|
||||
opts->allow_join_id0 = subflow_req->allow_join_id0;
|
||||
*size = TCPOLEN_MPTCP_MPC_SYNACK;
|
||||
pr_debug("subflow_req=%p, local_key=%llu",
|
||||
subflow_req, subflow_req->local_key);
|
||||
@@ -1201,6 +1204,9 @@ void mptcp_write_options(__be32 *ptr, const struct tcp_sock *tp,
|
||||
if (opts->csum_reqd)
|
||||
flag |= MPTCP_CAP_CHECKSUM_REQD;
|
||||
|
||||
if (!opts->allow_join_id0)
|
||||
flag |= MPTCP_CAP_DENY_JOIN_ID0;
|
||||
|
||||
*ptr++ = mptcp_option(MPTCPOPT_MP_CAPABLE, len,
|
||||
MPTCP_SUPPORTED_VERSION,
|
||||
flag);
|
||||
|
||||
Reference in New Issue
Block a user