@@ -128,7 +128,6 @@ static void subflow_init_req(struct request_sock *req,
pr_debug("subflow_req=%p, listener=%p", subflow_req, listener);
- memset(&mp_opt, 0, sizeof(mp_opt));
mptcp_get_options(skb, &mp_opt);
subflow_req->mp_capable = 0;
@@ -425,6 +424,9 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk,
pr_debug("listener=%p, req=%p, conn=%p", listener, req, listener->conn);
+ /* we need later a valid 'mp_capable' value even when options are not
+ * parsed
+ */
mp_opt.mp_capable = 0;
if (tcp_rsk(req)->is_mptcp == 0)
goto create_child;
@@ -452,7 +454,6 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk,
fallback = true;
} else if (subflow_req->mp_join) {
fallback_is_fatal = true;
- mp_opt.mp_join = 0;
mptcp_get_options(skb, &mp_opt);
if (!mp_opt.mp_join ||
!subflow_hmac_valid(req, &mp_opt)) {
The mptcp option status is always initialized by mptcp_get_options(), we can clean-up a couple of call sites open codying such task. Signed-off-by: Paolo Abeni <pabeni@redhat.com> --- this could be squashed into "mptcp: move option parsing into mptcp_incoming_options()", kept here to since the latter is already pretty big, but no strong opinion against squashing --- net/mptcp/subflow.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)