From nobody Fri Nov 22 12:09:04 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8771418594A; Mon, 2 Sep 2024 10:46:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725273975; cv=none; b=dgyc4UYbsQunX0ANoyl3RkCUvz6cF8i7/0XIRMM8mFkFAJSN4PWMho0tI1f//ZIMdbnpDopMjT2/kvCT9BmV1PWibyEGqA0PGwUMziUZV9Homb3+r1smdutDAEisO+k5QbaUtTKLKqJjis94qyHobm90EjbDMYDG89f/rYlnaDo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725273975; c=relaxed/simple; bh=uPXJ7emMKa+5QN/1bld1ruCPBaqlm+m4AQY7UI+VWnw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HwuI9FLiU1LtWqhDVGqJywEZ/xnldTemm/XhIoH69Ldt14LKW2JyTwJl5zVF4UGZMsgxCia5xtiBnE6ErX00QoiP6IwYab+797sBm9CyXScuSoA3I0TU95EQaDKObhTs76xTr9iaxaG5JoaV1VdUi9n4bXDTBnTiO8+B4bLsZqc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BIF8V7Rn; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BIF8V7Rn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9170BC4CEC2; Mon, 2 Sep 2024 10:46:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725273975; bh=uPXJ7emMKa+5QN/1bld1ruCPBaqlm+m4AQY7UI+VWnw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=BIF8V7RnGXVVnolPwQxdpzNyhzp1FxeW6lc848mBpEH8TxpEzgSuTh5saq6X9dniE eyaxHoP57Hl76lb7hK3jPo87qExk2TofWNBTeS802qYpQD7yrKo2ljHK6ZPa6P351j NT6TXDr1dHzsemzc531dh9T6Vb/S+OF74l6XVG1N0iQHgrv+QKzA8cBgK+Kn3zyfk5 T5iGh1gGuVUq2fubTCn5XmnGprxRP+60Tx1Ht64Cn25k6z5RphSG+2hvlWW3f4mpKI LgPeXCbSgJIPU1rkPsBLpTeOKuee3ftz0XxnBpo+CZ2xvhhgakH6QyBPkPzN2+QFYB pINNFscB8whnA== From: "Matthieu Baerts (NGI0)" Date: Mon, 02 Sep 2024 12:45:53 +0200 Subject: [PATCH net-next 02/11] mptcp: pm: reduce entries iterations on connect Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-2-d3e0f3773b90@kernel.org> References: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-0-d3e0f3773b90@kernel.org> In-Reply-To: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-0-d3e0f3773b90@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=15519; i=matttbe@kernel.org; h=from:subject:message-id; bh=uPXJ7emMKa+5QN/1bld1ruCPBaqlm+m4AQY7UI+VWnw=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBm1ZdtCT81seJNcho6yQWSdHOYZDIlwZfV2nDdT +cX61hQO7OJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZtWXbQAKCRD2t4JPQmmg c1xcEADJURpj7QA4cbVjviuIjEg0SjAs/Gd8XkWfzjyR4ZI8/zySu71jJchcdWZfSDI20NylR7/ S4umYY9/RQ4ALjvKOTUVdUC0EX4Qvqcw+8ih32KW/+Bc0uUN8vSiwkX9lGyoTGPeJh3MjWF51Iy Vf60zpFKvOePm+SGnuGY5C4UFLZTRUAPahB82skHgTOohFZZyL2wwAGPwPnyZY0dH73lbzlXWFa IrEMrZwVuCIZgFcoOOPsgkxYHbGUE7ifPKY8AZeejfzV2A3miadyYse3slBFfbDbxv209WHBY/a T+BYHwgZ1094IQWJwV8ZKaXEq1mBfzLS7+n8P6PKvxm3Q0A1LRshrpOopfVag/85Rzn0bPJLV/1 W67OKCjy3AizSW161an3qWBYYvNb7GFE1XWRX7gi+hDVOHfimbd0afSvYLGOesw9iDCufK4tYhd w8qToHf/dM0xrbB6WqvC2Wt7VkobDFdI8m5iFyjsQwpviB9Zg5083TicJgNouenZXbh05nl0Bnx CkeZFAMB8Qoph5PHmFsEufQhgxxddMY8OSk6OBPM6Flg9ZvueFzk7q6B+vmM6eH35zF50g8Dm2x ccHRGjQfgsVwW98pvWeFCI5Eq1T+e20KsX87X2kwK1WaAZJ+rBT0QL3fkXZgjRYFfsh31VnifGm d/feOTWnSIBN8sg== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 __mptcp_subflow_connect() is currently called from the path-managers, which have all the required information to create subflows. No need to call the PM again to re-iterate over the list of entries with RCU lock to get more info. Instead, it is possible to pass a mptcp_pm_addr_entry structure, instead of a mptcp_addr_info one. The former contains the ifindex and the flags that are required when creating the new subflow. This is a partial revert of commit ee285257a9c1 ("mptcp: drop flags and ifindex arguments"). While at it, the local ID can also be set if it is known and 0, to avoid having to set it in the 'rebuild_header' hook, which will cause a new iteration of the endpoint entries. Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/pm.c | 11 -------- net/mptcp/pm_netlink.c | 66 ++++++++++++++++++--------------------------= ---- net/mptcp/pm_userspace.c | 40 ++++++++++------------------- net/mptcp/protocol.h | 16 +++++------- net/mptcp/subflow.c | 29 +++++++++++++-------- 5 files changed, 62 insertions(+), 100 deletions(-) diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c index 37f6dbcd8434..620264c75dc2 100644 --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -430,17 +430,6 @@ bool mptcp_pm_is_backup(struct mptcp_sock *msk, struct= sock_common *skc) return mptcp_pm_nl_is_backup(msk, &skc_local); } =20 -int mptcp_pm_get_flags_and_ifindex_by_id(struct mptcp_sock *msk, unsigned = int id, - u8 *flags, int *ifindex) -{ - *flags =3D 0; - *ifindex =3D 0; - - if (mptcp_pm_is_userspace(msk)) - return mptcp_userspace_pm_get_flags_and_ifindex_by_id(msk, id, flags, if= index); - return mptcp_pm_nl_get_flags_and_ifindex_by_id(msk, id, flags, ifindex); -} - int mptcp_pm_get_addr(struct sk_buff *skb, struct genl_info *info) { if (info->attrs[MPTCP_PM_ATTR_TOKEN]) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 275959581586..62a42f7ee7cb 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -149,7 +149,7 @@ static bool lookup_subflow_by_daddr(const struct list_h= ead *list, static bool select_local_address(const struct pm_nl_pernet *pernet, const struct mptcp_sock *msk, - struct mptcp_pm_addr_entry *new_entry) + struct mptcp_pm_local *new_local) { struct mptcp_pm_addr_entry *entry; bool found =3D false; @@ -164,7 +164,9 @@ select_local_address(const struct pm_nl_pernet *pernet, if (!test_bit(entry->addr.id, msk->pm.id_avail_bitmap)) continue; =20 - *new_entry =3D *entry; + new_local->addr =3D entry->addr; + new_local->flags =3D entry->flags; + new_local->ifindex =3D entry->ifindex; found =3D true; break; } @@ -175,7 +177,7 @@ select_local_address(const struct pm_nl_pernet *pernet, =20 static bool select_signal_address(struct pm_nl_pernet *pernet, const struct mptcp_sock= *msk, - struct mptcp_pm_addr_entry *new_entry) + struct mptcp_pm_local *new_local) { struct mptcp_pm_addr_entry *entry; bool found =3D false; @@ -193,7 +195,9 @@ select_signal_address(struct pm_nl_pernet *pernet, cons= t struct mptcp_sock *msk, if (!(entry->flags & MPTCP_PM_ADDR_FLAG_SIGNAL)) continue; =20 - *new_entry =3D *entry; + new_local->addr =3D entry->addr; + new_local->flags =3D entry->flags; + new_local->ifindex =3D entry->ifindex; found =3D true; break; } @@ -524,11 +528,11 @@ __lookup_addr(struct pm_nl_pernet *pernet, const stru= ct mptcp_addr_info *info) static void mptcp_pm_create_subflow_or_signal_addr(struct mptcp_sock *msk) { struct sock *sk =3D (struct sock *)msk; - struct mptcp_pm_addr_entry local; unsigned int add_addr_signal_max; bool signal_and_subflow =3D false; unsigned int local_addr_max; struct pm_nl_pernet *pernet; + struct mptcp_pm_local local; unsigned int subflows_max; =20 pernet =3D pm_nl_get_pernet(sock_net(sk)); @@ -629,7 +633,7 @@ static void mptcp_pm_create_subflow_or_signal_addr(stru= ct mptcp_sock *msk) =20 spin_unlock_bh(&msk->pm.lock); for (i =3D 0; i < nr; i++) - __mptcp_subflow_connect(sk, &local.addr, &addrs[i]); + __mptcp_subflow_connect(sk, &local, &addrs[i]); spin_lock_bh(&msk->pm.lock); } mptcp_pm_nl_check_work_pending(msk); @@ -650,7 +654,7 @@ static void mptcp_pm_nl_subflow_established(struct mptc= p_sock *msk) */ static unsigned int fill_local_addresses_vec(struct mptcp_sock *msk, struct mptcp_addr_info *remote, - struct mptcp_addr_info *addrs) + struct mptcp_pm_local *locals) { struct sock *sk =3D (struct sock *)msk; struct mptcp_pm_addr_entry *entry; @@ -673,13 +677,15 @@ static unsigned int fill_local_addresses_vec(struct m= ptcp_sock *msk, continue; =20 if (msk->pm.subflows < subflows_max) { - msk->pm.subflows++; - addrs[i] =3D entry->addr; + locals[i].addr =3D entry->addr; + locals[i].flags =3D entry->flags; + locals[i].ifindex =3D entry->ifindex; =20 /* Special case for ID0: set the correct ID */ - if (mptcp_addresses_equal(&entry->addr, &mpc_addr, entry->addr.port)) - addrs[i].id =3D 0; + if (mptcp_addresses_equal(&locals[i].addr, &mpc_addr, locals[i].addr.po= rt)) + locals[i].addr.id =3D 0; =20 + msk->pm.subflows++; i++; } } @@ -689,21 +695,19 @@ static unsigned int fill_local_addresses_vec(struct m= ptcp_sock *msk, * 'IPADDRANY' local address */ if (!i) { - struct mptcp_addr_info local; - - memset(&local, 0, sizeof(local)); - local.family =3D + memset(&locals[i], 0, sizeof(locals[i])); + locals[i].addr.family =3D #if IS_ENABLED(CONFIG_MPTCP_IPV6) remote->family =3D=3D AF_INET6 && ipv6_addr_v4mapped(&remote->addr6) ? AF_INET : #endif remote->family; =20 - if (!mptcp_pm_addr_families_match(sk, &local, remote)) + if (!mptcp_pm_addr_families_match(sk, &locals[i].addr, remote)) return 0; =20 msk->pm.subflows++; - addrs[i++] =3D local; + i++; } =20 return i; @@ -711,7 +715,7 @@ static unsigned int fill_local_addresses_vec(struct mpt= cp_sock *msk, =20 static void mptcp_pm_nl_add_addr_received(struct mptcp_sock *msk) { - struct mptcp_addr_info addrs[MPTCP_PM_ADDR_MAX]; + struct mptcp_pm_local locals[MPTCP_PM_ADDR_MAX]; struct sock *sk =3D (struct sock *)msk; unsigned int add_addr_accept_max; struct mptcp_addr_info remote; @@ -740,13 +744,13 @@ static void mptcp_pm_nl_add_addr_received(struct mptc= p_sock *msk) /* connect to the specified remote address, using whatever * local address the routing configuration will pick. */ - nr =3D fill_local_addresses_vec(msk, &remote, addrs); + nr =3D fill_local_addresses_vec(msk, &remote, locals); if (nr =3D=3D 0) return; =20 spin_unlock_bh(&msk->pm.lock); for (i =3D 0; i < nr; i++) - if (__mptcp_subflow_connect(sk, &addrs[i], &remote) =3D=3D 0) + if (__mptcp_subflow_connect(sk, &locals[i], &remote) =3D=3D 0) sf_created =3D true; spin_lock_bh(&msk->pm.lock); =20 @@ -1433,28 +1437,6 @@ int mptcp_pm_nl_add_addr_doit(struct sk_buff *skb, s= truct genl_info *info) return ret; } =20 -int mptcp_pm_nl_get_flags_and_ifindex_by_id(struct mptcp_sock *msk, unsign= ed int id, - u8 *flags, int *ifindex) -{ - struct mptcp_pm_addr_entry *entry; - struct sock *sk =3D (struct sock *)msk; - struct net *net =3D sock_net(sk); - - /* No entries with ID 0 */ - if (id =3D=3D 0) - return 0; - - rcu_read_lock(); - entry =3D __lookup_addr_by_id(pm_nl_get_pernet(net), id); - if (entry) { - *flags =3D entry->flags; - *ifindex =3D entry->ifindex; - } - rcu_read_unlock(); - - return 0; -} - static bool remove_anno_list_by_saddr(struct mptcp_sock *msk, const struct mptcp_addr_info *addr) { diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c index 8eaa9fbe3e34..2cceded3a83a 100644 --- a/net/mptcp/pm_userspace.c +++ b/net/mptcp/pm_userspace.c @@ -119,23 +119,6 @@ mptcp_userspace_pm_lookup_addr_by_id(struct mptcp_sock= *msk, unsigned int id) return NULL; } =20 -int mptcp_userspace_pm_get_flags_and_ifindex_by_id(struct mptcp_sock *msk, - unsigned int id, - u8 *flags, int *ifindex) -{ - struct mptcp_pm_addr_entry *match; - - spin_lock_bh(&msk->pm.lock); - match =3D mptcp_userspace_pm_lookup_addr_by_id(msk, id); - spin_unlock_bh(&msk->pm.lock); - if (match) { - *flags =3D match->flags; - *ifindex =3D match->ifindex; - } - - return 0; -} - int mptcp_userspace_pm_get_local_id(struct mptcp_sock *msk, struct mptcp_addr_info *skc) { @@ -352,8 +335,9 @@ int mptcp_pm_nl_subflow_create_doit(struct sk_buff *skb= , struct genl_info *info) struct nlattr *raddr =3D info->attrs[MPTCP_PM_ATTR_ADDR_REMOTE]; struct nlattr *token =3D info->attrs[MPTCP_PM_ATTR_TOKEN]; struct nlattr *laddr =3D info->attrs[MPTCP_PM_ATTR_ADDR]; - struct mptcp_pm_addr_entry local =3D { 0 }; + struct mptcp_pm_addr_entry entry =3D { 0 }; struct mptcp_addr_info addr_r; + struct mptcp_pm_local local; struct mptcp_sock *msk; int err =3D -EINVAL; struct sock *sk; @@ -379,18 +363,18 @@ int mptcp_pm_nl_subflow_create_doit(struct sk_buff *s= kb, struct genl_info *info) goto create_err; } =20 - err =3D mptcp_pm_parse_entry(laddr, info, true, &local); + err =3D mptcp_pm_parse_entry(laddr, info, true, &entry); if (err < 0) { NL_SET_ERR_MSG_ATTR(info->extack, laddr, "error parsing local addr"); goto create_err; } =20 - if (local.flags & MPTCP_PM_ADDR_FLAG_SIGNAL) { + if (entry.flags & MPTCP_PM_ADDR_FLAG_SIGNAL) { GENL_SET_ERR_MSG(info, "invalid addr flags"); err =3D -EINVAL; goto create_err; } - local.flags |=3D MPTCP_PM_ADDR_FLAG_SUBFLOW; + entry.flags |=3D MPTCP_PM_ADDR_FLAG_SUBFLOW; =20 err =3D mptcp_pm_parse_addr(raddr, info, &addr_r); if (err < 0) { @@ -398,27 +382,29 @@ int mptcp_pm_nl_subflow_create_doit(struct sk_buff *s= kb, struct genl_info *info) goto create_err; } =20 - if (!mptcp_pm_addr_families_match(sk, &local.addr, &addr_r)) { + if (!mptcp_pm_addr_families_match(sk, &entry.addr, &addr_r)) { GENL_SET_ERR_MSG(info, "families mismatch"); err =3D -EINVAL; goto create_err; } =20 - err =3D mptcp_userspace_pm_append_new_local_addr(msk, &local, false); + err =3D mptcp_userspace_pm_append_new_local_addr(msk, &entry, false); if (err < 0) { GENL_SET_ERR_MSG(info, "did not match address and id"); goto create_err; } =20 + local.addr =3D entry.addr; + local.flags =3D entry.flags; + local.ifindex =3D entry.ifindex; + lock_sock(sk); - - err =3D __mptcp_subflow_connect(sk, &local.addr, &addr_r); - + err =3D __mptcp_subflow_connect(sk, &local, &addr_r); release_sock(sk); =20 spin_lock_bh(&msk->pm.lock); if (err) - mptcp_userspace_pm_delete_local_addr(msk, &local); + mptcp_userspace_pm_delete_local_addr(msk, &entry); else msk->pm.subflows++; spin_unlock_bh(&msk->pm.lock); diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index 3735b20f2626..bf03bff9ac44 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -236,6 +236,12 @@ struct mptcp_pm_data { struct mptcp_rm_list rm_list_rx; }; =20 +struct mptcp_pm_local { + struct mptcp_addr_info addr; + u8 flags; + int ifindex; +}; + struct mptcp_pm_addr_entry { struct list_head list; struct mptcp_addr_info addr; @@ -719,7 +725,7 @@ bool mptcp_addresses_equal(const struct mptcp_addr_info= *a, void mptcp_local_address(const struct sock_common *skc, struct mptcp_addr_= info *addr); =20 /* called with sk socket lock held */ -int __mptcp_subflow_connect(struct sock *sk, const struct mptcp_addr_info = *loc, +int __mptcp_subflow_connect(struct sock *sk, const struct mptcp_pm_local *= local, const struct mptcp_addr_info *remote); int mptcp_subflow_create_socket(struct sock *sk, unsigned short family, struct socket **new_sock); @@ -1014,14 +1020,6 @@ mptcp_pm_del_add_timer(struct mptcp_sock *msk, struct mptcp_pm_add_entry * mptcp_lookup_anno_list_by_saddr(const struct mptcp_sock *msk, const struct mptcp_addr_info *addr); -int mptcp_pm_get_flags_and_ifindex_by_id(struct mptcp_sock *msk, - unsigned int id, - u8 *flags, int *ifindex); -int mptcp_pm_nl_get_flags_and_ifindex_by_id(struct mptcp_sock *msk, unsign= ed int id, - u8 *flags, int *ifindex); -int mptcp_userspace_pm_get_flags_and_ifindex_by_id(struct mptcp_sock *msk, - unsigned int id, - u8 *flags, int *ifindex); int mptcp_pm_set_flags(struct sk_buff *skb, struct genl_info *info); int mptcp_pm_nl_set_flags(struct sk_buff *skb, struct genl_info *info); int mptcp_userspace_pm_set_flags(struct sk_buff *skb, struct genl_info *in= fo); diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index 064ab3235893..0796122c9467 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -1565,26 +1565,24 @@ void mptcp_info2sockaddr(const struct mptcp_addr_in= fo *info, #endif } =20 -int __mptcp_subflow_connect(struct sock *sk, const struct mptcp_addr_info = *loc, +int __mptcp_subflow_connect(struct sock *sk, const struct mptcp_pm_local *= local, const struct mptcp_addr_info *remote) { struct mptcp_sock *msk =3D mptcp_sk(sk); struct mptcp_subflow_context *subflow; + int local_id =3D local->addr.id; struct sockaddr_storage addr; int remote_id =3D remote->id; - int local_id =3D loc->id; int err =3D -ENOTCONN; struct socket *sf; struct sock *ssk; u32 remote_token; int addrlen; - int ifindex; - u8 flags; =20 if (!mptcp_is_fully_established(sk)) goto err_out; =20 - err =3D mptcp_subflow_create_socket(sk, loc->family, &sf); + err =3D mptcp_subflow_create_socket(sk, local->addr.family, &sf); if (err) goto err_out; =20 @@ -1594,23 +1592,32 @@ int __mptcp_subflow_connect(struct sock *sk, const = struct mptcp_addr_info *loc, get_random_bytes(&subflow->local_nonce, sizeof(u32)); } while (!subflow->local_nonce); =20 - if (local_id) + /* if 'IPADDRANY', the ID will be set later, after the routing */ + if (local->addr.family =3D=3D AF_INET) { + if (!local->addr.addr.s_addr) + local_id =3D -1; +#if IS_ENABLED(CONFIG_MPTCP_IPV6) + } else if (sk->sk_family =3D=3D AF_INET6) { + if (ipv6_addr_any(&local->addr.addr6)) + local_id =3D -1; +#endif + } + + if (local_id >=3D 0) subflow_set_local_id(subflow, local_id); =20 - mptcp_pm_get_flags_and_ifindex_by_id(msk, local_id, - &flags, &ifindex); subflow->remote_key_valid =3D 1; subflow->remote_key =3D READ_ONCE(msk->remote_key); subflow->local_key =3D READ_ONCE(msk->local_key); subflow->token =3D msk->token; - mptcp_info2sockaddr(loc, &addr, ssk->sk_family); + mptcp_info2sockaddr(&local->addr, &addr, ssk->sk_family); =20 addrlen =3D sizeof(struct sockaddr_in); #if IS_ENABLED(CONFIG_MPTCP_IPV6) if (addr.ss_family =3D=3D AF_INET6) addrlen =3D sizeof(struct sockaddr_in6); #endif - ssk->sk_bound_dev_if =3D ifindex; + ssk->sk_bound_dev_if =3D local->ifindex; err =3D kernel_bind(sf, (struct sockaddr *)&addr, addrlen); if (err) goto failed; @@ -1621,7 +1628,7 @@ int __mptcp_subflow_connect(struct sock *sk, const st= ruct mptcp_addr_info *loc, subflow->remote_token =3D remote_token; WRITE_ONCE(subflow->remote_id, remote_id); subflow->request_join =3D 1; - subflow->request_bkup =3D !!(flags & MPTCP_PM_ADDR_FLAG_BACKUP); + subflow->request_bkup =3D !!(local->flags & MPTCP_PM_ADDR_FLAG_BACKUP); subflow->subflow_id =3D msk->subflow_id++; mptcp_info2sockaddr(remote, &addr, ssk->sk_family); =20 --=20 2.45.2