Skip to content

Commit

Permalink
mptcp: move subflow close loop after sk close check
Browse files Browse the repository at this point in the history
In case mptcp socket is already dead the entire mptcp socket
will be freed. We can avoid the close check in this case.

Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
  • Loading branch information
Florian Westphal authored and jenkins-tessares committed Feb 7, 2021
1 parent 8099dad commit ac2f529
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/mptcp/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -2242,9 +2242,6 @@ static void mptcp_worker(struct work_struct *work)

mptcp_check_fastclose(msk);

if (test_and_clear_bit(MPTCP_WORK_CLOSE_SUBFLOW, &msk->flags))
__mptcp_close_subflow(msk);

if (msk->pm.status)
mptcp_pm_nl_work(msk);

Expand All @@ -2266,6 +2263,9 @@ static void mptcp_worker(struct work_struct *work)
goto unlock;
}

if (test_and_clear_bit(MPTCP_WORK_CLOSE_SUBFLOW, &msk->flags))
__mptcp_close_subflow(msk);

if (!test_and_clear_bit(MPTCP_WORK_RTX, &msk->flags))
goto unlock;

Expand Down

0 comments on commit ac2f529

Please sign in to comment.