Skip to content

Commit 82f2515

Browse files
Geliang Tangintel-lab-lkp
authored andcommitted
mptcp: implement mptcp_pm_connection_closed
The MPTCP path manager event handler mptcp_pm_connection_closed interface is added in the commit "mptcp: Add path manager interface", but it was an empty function from then on. It makes sense to invoke mptcp_event with the MPTCP_EVENT_CLOSED event type in it. Signed-off-by: Geliang Tang <[email protected]>
1 parent 1d732d3 commit 82f2515

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

net/mptcp/pm.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ void mptcp_pm_fully_established(struct mptcp_sock *msk, const struct sock *ssk)
154154
void mptcp_pm_connection_closed(struct mptcp_sock *msk)
155155
{
156156
pr_debug("msk=%p\n", msk);
157+
158+
if (msk->token)
159+
mptcp_event(MPTCP_EVENT_CLOSED, msk, NULL, GFP_KERNEL);
157160
}
158161

159162
void mptcp_pm_subflow_established(struct mptcp_sock *msk)

net/mptcp/protocol.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3121,8 +3121,7 @@ bool __mptcp_close(struct sock *sk, long timeout)
31213121

31223122
sock_hold(sk);
31233123
pr_debug("msk=%p state=%d\n", sk, sk->sk_state);
3124-
if (msk->token)
3125-
mptcp_event(MPTCP_EVENT_CLOSED, msk, NULL, GFP_KERNEL);
3124+
mptcp_pm_connection_closed(msk);
31263125

31273126
if (sk->sk_state == TCP_CLOSE) {
31283127
__mptcp_destroy_sock(sk);
@@ -3188,8 +3187,7 @@ static int mptcp_disconnect(struct sock *sk, int flags)
31883187
mptcp_stop_rtx_timer(sk);
31893188
mptcp_stop_tout_timer(sk);
31903189

3191-
if (msk->token)
3192-
mptcp_event(MPTCP_EVENT_CLOSED, msk, NULL, GFP_KERNEL);
3190+
mptcp_pm_connection_closed(msk);
31933191

31943192
/* msk->subflow is still intact, the following will not free the first
31953193
* subflow

0 commit comments

Comments
 (0)