Skip to content

Commit

Permalink
mptcp: implement mptcp_pm_connection_closed
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Geliang Tang authored and intel-lab-lkp committed Sep 9, 2024
1 parent 1d732d3 commit 82f2515
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 3 additions & 0 deletions net/mptcp/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ void mptcp_pm_fully_established(struct mptcp_sock *msk, const struct sock *ssk)
void mptcp_pm_connection_closed(struct mptcp_sock *msk)
{
pr_debug("msk=%p\n", msk);

if (msk->token)
mptcp_event(MPTCP_EVENT_CLOSED, msk, NULL, GFP_KERNEL);
}

void mptcp_pm_subflow_established(struct mptcp_sock *msk)
Expand Down
6 changes: 2 additions & 4 deletions net/mptcp/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -3121,8 +3121,7 @@ bool __mptcp_close(struct sock *sk, long timeout)

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

if (sk->sk_state == TCP_CLOSE) {
__mptcp_destroy_sock(sk);
Expand Down Expand Up @@ -3188,8 +3187,7 @@ static int mptcp_disconnect(struct sock *sk, int flags)
mptcp_stop_rtx_timer(sk);
mptcp_stop_tout_timer(sk);

if (msk->token)
mptcp_event(MPTCP_EVENT_CLOSED, msk, NULL, GFP_KERNEL);
mptcp_pm_connection_closed(msk);

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

0 comments on commit 82f2515

Please sign in to comment.