Message ID | 1c0a240472edcc1afbcb822bd9af3cf03800759e.1617014019.git.geliangtang@gmail.com |
---|---|
State | Superseded, archived |
Delegated to: | Mat Martineau |
Headers | show |
Series | data checksum support | expand |
On Mon, 29 Mar 2021, Geliang Tang wrote: > This patch added a new parameter name sk in mptcp_parse_option() and > mptcp_get_options(). > > Signed-off-by: Geliang Tang <geliangtang@gmail.com> > --- Could you squash patches 7, 8, and 9 to help keep the patch set size under 15 (netdev patchwork flags patchsets longer than that)? Thanks, Mat > net/mptcp/options.c | 10 ++++++---- > net/mptcp/protocol.h | 3 ++- > net/mptcp/subflow.c | 10 +++++----- > 3 files changed, 13 insertions(+), 10 deletions(-) > > diff --git a/net/mptcp/options.c b/net/mptcp/options.c > index 6acb7469bae9..cb423cba5c3b 100644 > --- a/net/mptcp/options.c > +++ b/net/mptcp/options.c > @@ -20,7 +20,8 @@ static bool mptcp_cap_flag_sha256(u8 flags) > return (flags & MPTCP_CAP_FLAG_MASK) == MPTCP_CAP_HMAC_SHA256; > } > > -static void mptcp_parse_option(const struct sk_buff *skb, > +static void mptcp_parse_option(const struct sock *sk, > + const struct sk_buff *skb, > const unsigned char *ptr, int opsize, > struct mptcp_options_received *mp_opt) > { > @@ -322,7 +323,8 @@ static void mptcp_parse_option(const struct sk_buff *skb, > } > } > > -void mptcp_get_options(const struct sk_buff *skb, > +void mptcp_get_options(const struct sock *sk, > + const struct sk_buff *skb, > struct mptcp_options_received *mp_opt) > { > const struct tcphdr *th = tcp_hdr(skb); > @@ -362,7 +364,7 @@ void mptcp_get_options(const struct sk_buff *skb, > if (opsize > length) > return; /* don't parse partial options */ > if (opcode == TCPOPT_MPTCP) > - mptcp_parse_option(skb, ptr, opsize, mp_opt); > + mptcp_parse_option(sk, skb, ptr, opsize, mp_opt); > ptr += opsize - 2; > length -= opsize; > } > @@ -1016,7 +1018,7 @@ void mptcp_incoming_options(struct sock *sk, struct sk_buff *skb) > return; > } > > - mptcp_get_options(skb, &mp_opt); > + mptcp_get_options(sk, skb, &mp_opt); > if (!check_fully_established(msk, sk, subflow, skb, &mp_opt)) > return; > > diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h > index ae7d47352d09..cfdecfb90776 100644 > --- a/net/mptcp/protocol.h > +++ b/net/mptcp/protocol.h > @@ -570,7 +570,8 @@ int __init mptcp_proto_v6_init(void); > struct sock *mptcp_sk_clone(const struct sock *sk, > const struct mptcp_options_received *mp_opt, > struct request_sock *req); > -void mptcp_get_options(const struct sk_buff *skb, > +void mptcp_get_options(const struct sock *sk, > + const struct sk_buff *skb, > struct mptcp_options_received *mp_opt); > > void mptcp_finish_connect(struct sock *sk); > diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c > index cbdfa5a6f8f6..75664da251a6 100644 > --- a/net/mptcp/subflow.c > +++ b/net/mptcp/subflow.c > @@ -151,7 +151,7 @@ static int subflow_check_req(struct request_sock *req, > return -EINVAL; > #endif > > - mptcp_get_options(skb, &mp_opt); > + mptcp_get_options(sk_listener, skb, &mp_opt); > > if (mp_opt.mp_capable) { > SUBFLOW_REQ_INC_STATS(req, MPTCP_MIB_MPCAPABLEPASSIVE); > @@ -248,7 +248,7 @@ int mptcp_subflow_init_cookie_req(struct request_sock *req, > int err; > > subflow_init_req(req, sk_listener); > - mptcp_get_options(skb, &mp_opt); > + mptcp_get_options(sk_listener, skb, &mp_opt); > > if (mp_opt.mp_capable && mp_opt.mp_join) > return -EINVAL; > @@ -395,7 +395,7 @@ static void subflow_finish_connect(struct sock *sk, const struct sk_buff *skb) > subflow->ssn_offset = TCP_SKB_CB(skb)->seq; > pr_debug("subflow=%p synack seq=%x", subflow, subflow->ssn_offset); > > - mptcp_get_options(skb, &mp_opt); > + mptcp_get_options(sk, skb, &mp_opt); > if (subflow->request_mptcp) { > if (!mp_opt.mp_capable) { > MPTCP_INC_STATS(sock_net(sk), > @@ -642,7 +642,7 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk, > goto create_msk; > } > > - mptcp_get_options(skb, &mp_opt); > + mptcp_get_options(sk, skb, &mp_opt); > if (!mp_opt.mp_capable) { > fallback = true; > goto create_child; > @@ -653,7 +653,7 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk, > if (!new_msk) > fallback = true; > } else if (subflow_req->mp_join) { > - mptcp_get_options(skb, &mp_opt); > + mptcp_get_options(sk, skb, &mp_opt); > if (!mp_opt.mp_join || !subflow_hmac_valid(req, &mp_opt) || > !mptcp_can_accept_new_subflow(subflow_req->msk)) { > SUBFLOW_REQ_INC_STATS(req, MPTCP_MIB_JOINACKMAC); > -- > 2.30.2 > > > -- Mat Martineau Intel
diff --git a/net/mptcp/options.c b/net/mptcp/options.c index 6acb7469bae9..cb423cba5c3b 100644 --- a/net/mptcp/options.c +++ b/net/mptcp/options.c @@ -20,7 +20,8 @@ static bool mptcp_cap_flag_sha256(u8 flags) return (flags & MPTCP_CAP_FLAG_MASK) == MPTCP_CAP_HMAC_SHA256; } -static void mptcp_parse_option(const struct sk_buff *skb, +static void mptcp_parse_option(const struct sock *sk, + const struct sk_buff *skb, const unsigned char *ptr, int opsize, struct mptcp_options_received *mp_opt) { @@ -322,7 +323,8 @@ static void mptcp_parse_option(const struct sk_buff *skb, } } -void mptcp_get_options(const struct sk_buff *skb, +void mptcp_get_options(const struct sock *sk, + const struct sk_buff *skb, struct mptcp_options_received *mp_opt) { const struct tcphdr *th = tcp_hdr(skb); @@ -362,7 +364,7 @@ void mptcp_get_options(const struct sk_buff *skb, if (opsize > length) return; /* don't parse partial options */ if (opcode == TCPOPT_MPTCP) - mptcp_parse_option(skb, ptr, opsize, mp_opt); + mptcp_parse_option(sk, skb, ptr, opsize, mp_opt); ptr += opsize - 2; length -= opsize; } @@ -1016,7 +1018,7 @@ void mptcp_incoming_options(struct sock *sk, struct sk_buff *skb) return; } - mptcp_get_options(skb, &mp_opt); + mptcp_get_options(sk, skb, &mp_opt); if (!check_fully_established(msk, sk, subflow, skb, &mp_opt)) return; diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index ae7d47352d09..cfdecfb90776 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -570,7 +570,8 @@ int __init mptcp_proto_v6_init(void); struct sock *mptcp_sk_clone(const struct sock *sk, const struct mptcp_options_received *mp_opt, struct request_sock *req); -void mptcp_get_options(const struct sk_buff *skb, +void mptcp_get_options(const struct sock *sk, + const struct sk_buff *skb, struct mptcp_options_received *mp_opt); void mptcp_finish_connect(struct sock *sk); diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index cbdfa5a6f8f6..75664da251a6 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -151,7 +151,7 @@ static int subflow_check_req(struct request_sock *req, return -EINVAL; #endif - mptcp_get_options(skb, &mp_opt); + mptcp_get_options(sk_listener, skb, &mp_opt); if (mp_opt.mp_capable) { SUBFLOW_REQ_INC_STATS(req, MPTCP_MIB_MPCAPABLEPASSIVE); @@ -248,7 +248,7 @@ int mptcp_subflow_init_cookie_req(struct request_sock *req, int err; subflow_init_req(req, sk_listener); - mptcp_get_options(skb, &mp_opt); + mptcp_get_options(sk_listener, skb, &mp_opt); if (mp_opt.mp_capable && mp_opt.mp_join) return -EINVAL; @@ -395,7 +395,7 @@ static void subflow_finish_connect(struct sock *sk, const struct sk_buff *skb) subflow->ssn_offset = TCP_SKB_CB(skb)->seq; pr_debug("subflow=%p synack seq=%x", subflow, subflow->ssn_offset); - mptcp_get_options(skb, &mp_opt); + mptcp_get_options(sk, skb, &mp_opt); if (subflow->request_mptcp) { if (!mp_opt.mp_capable) { MPTCP_INC_STATS(sock_net(sk), @@ -642,7 +642,7 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk, goto create_msk; } - mptcp_get_options(skb, &mp_opt); + mptcp_get_options(sk, skb, &mp_opt); if (!mp_opt.mp_capable) { fallback = true; goto create_child; @@ -653,7 +653,7 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk, if (!new_msk) fallback = true; } else if (subflow_req->mp_join) { - mptcp_get_options(skb, &mp_opt); + mptcp_get_options(sk, skb, &mp_opt); if (!mp_opt.mp_join || !subflow_hmac_valid(req, &mp_opt) || !mptcp_can_accept_new_subflow(subflow_req->msk)) { SUBFLOW_REQ_INC_STATS(req, MPTCP_MIB_JOINACKMAC);
This patch added a new parameter name sk in mptcp_parse_option() and mptcp_get_options(). Signed-off-by: Geliang Tang <geliangtang@gmail.com> --- net/mptcp/options.c | 10 ++++++---- net/mptcp/protocol.h | 3 ++- net/mptcp/subflow.c | 10 +++++----- 3 files changed, 13 insertions(+), 10 deletions(-)