diff options
author | Paolo Abeni <pabeni@redhat.com> | 2022-01-07 01:20:16 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-01-07 12:27:06 +0100 |
commit | b29fcfb54cd70caca5b11c80d8d238854938884a (patch) | |
tree | ce6469a982603e3dddbe67c5c3205b961324e437 /net/mptcp/pm.c | |
parent | mptcp: implement fastclose xmit path (diff) | |
download | linux-b29fcfb54cd70caca5b11c80d8d238854938884a.tar.xz linux-b29fcfb54cd70caca5b11c80d8d238854938884a.zip |
mptcp: full disconnect implementation
The current mptcp_disconnect() implementation lacks several
steps, we additionally need to reset the msk socket state
and flush the subflow list.
Factor out the needed helper to avoid code duplication.
Additionally ensure that the initial subflow is disposed
only after mptcp_close(), just reset it at disconnect time.
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mptcp/pm.c')
-rw-r--r-- | net/mptcp/pm.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c index 6ab386ff3294..6b2bfe89d445 100644 --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -356,7 +356,7 @@ void mptcp_pm_subflow_chk_stale(const struct mptcp_sock *msk, struct sock *ssk) } } -void mptcp_pm_data_init(struct mptcp_sock *msk) +void mptcp_pm_data_reset(struct mptcp_sock *msk) { msk->pm.add_addr_signaled = 0; msk->pm.add_addr_accepted = 0; @@ -371,10 +371,14 @@ void mptcp_pm_data_init(struct mptcp_sock *msk) WRITE_ONCE(msk->pm.remote_deny_join_id0, false); msk->pm.status = 0; + mptcp_pm_nl_data_init(msk); +} + +void mptcp_pm_data_init(struct mptcp_sock *msk) +{ spin_lock_init(&msk->pm.lock); INIT_LIST_HEAD(&msk->pm.anno_list); - - mptcp_pm_nl_data_init(msk); + mptcp_pm_data_reset(msk); } void __init mptcp_pm_init(void) |