MPTCP Linux Development
 help / color / mirror / Atom feed
* [MPTCP] Re: [MPTCP][PATCH mptcp-next 2/2] mptcp: remove id 0 address
@ 2021-02-23  1:13 Mat Martineau
  0 siblings, 0 replies; only message in thread
From: Mat Martineau @ 2021-02-23  1:13 UTC (permalink / raw)
  To: mptcp 

[-- Attachment #1: Type: text/plain, Size: 2553 bytes --]

On Mon, 22 Feb 2021, Geliang Tang wrote:

> If the removing address id is 0, invoke __mptcp_wr_shutdown to shutdown
> the initial subflow.
>
> Signed-off-by: Geliang Tang <geliangtang(a)gmail.com>
> ---
> net/mptcp/pm_netlink.c | 8 ++++++--
> net/mptcp/protocol.c   | 2 +-
> net/mptcp/protocol.h   | 1 +
> 3 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
> index d5cdfc18b40a..7a5e347a42a3 100644
> --- a/net/mptcp/pm_netlink.c
> +++ b/net/mptcp/pm_netlink.c
> @@ -634,8 +634,12 @@ static void mptcp_pm_nl_rm_addr_or_subflow(struct mptcp_sock *msk,
> 			pr_debug(" -> %s rm_list_ids[%d]=%u",
> 				 type == RM_ADDR ? "address" : "subflow", i, rm_list.ids[i]);
> 			spin_unlock_bh(&msk->pm.lock);
> -			mptcp_subflow_shutdown(sk, ssk, how);
> -			mptcp_close_ssk(sk, ssk, subflow);
> +			if (rm_list.ids[i]) {
> +				mptcp_subflow_shutdown(sk, ssk, how);
> +				mptcp_close_ssk(sk, ssk, subflow);
> +			} else {
> +				__mptcp_wr_shutdown(sk);

__mptcp_wr_shutdown will send DATA_FIN for the whole MPTCP connection, not 
just the initial subflow. In your test does the MPTCP connection stay open 
using other subflows?

Mat


> +			}
> 			spin_lock_bh(&msk->pm.lock);
>
> 			if (type == RM_ADDR) {
> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index 6b4eac26256f..ec808187fa0e 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
> @@ -2518,7 +2518,7 @@ static void __mptcp_check_send_data_fin(struct sock *sk)
> 	}
> }
>
> -static void __mptcp_wr_shutdown(struct sock *sk)
> +void __mptcp_wr_shutdown(struct sock *sk)
> {
> 	struct mptcp_sock *msk = mptcp_sk(sk);
>
> diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
> index 6af3e259fa05..e63ba987ab78 100644
> --- a/net/mptcp/protocol.h
> +++ b/net/mptcp/protocol.h
> @@ -538,6 +538,7 @@ void __init mptcp_subflow_init(void);
> void mptcp_subflow_shutdown(struct sock *sk, struct sock *ssk, int how);
> void mptcp_close_ssk(struct sock *sk, struct sock *ssk,
> 		     struct mptcp_subflow_context *subflow);
> +void __mptcp_wr_shutdown(struct sock *sk);
> void mptcp_subflow_reset(struct sock *ssk);
> void mptcp_sock_graft(struct sock *sk, struct socket *parent);
> struct socket *__mptcp_nmpc_socket(const struct mptcp_sock *msk);
> -- 
> 2.29.2
> _______________________________________________
> mptcp mailing list -- mptcp(a)lists.01.org
> To unsubscribe send an email to mptcp-leave(a)lists.01.org
>

--
Mat Martineau
Intel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-23  1:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-23  1:13 [MPTCP] Re: [MPTCP][PATCH mptcp-next 2/2] mptcp: remove id 0 address Mat Martineau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox