Skip to content

Commit

Permalink
mptcp: do not wakeup listener for MPJ subflows
Browse files Browse the repository at this point in the history
MPJ subflows are not exposed as fds to user spaces. As such,
incoming MPJ subflows are removed from the accept queue by
tcp_check_req()/tcp_get_cookie_sock().

Later tcp_child_process() invokes subflow_data_ready() on the
parent socket regardless of the subflow kind, leading to poll
wakeups even if the later accept will block.

Address the issue double checking the queue state before
waking the user-space.

Closes: #164
Reported-by: Dr. David Alan Gilbert <[email protected]>
Fixes: f296234 ("mptcp: Add handling of incoming MP_JOIN requests")
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Paolo Abeni <[email protected]>
  • Loading branch information
Paolo Abeni authored and jenkins-tessares committed Feb 23, 2021
1 parent b578f6c commit d1581f4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions net/mptcp/subflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,12 @@ static void subflow_data_ready(struct sock *sk)

msk = mptcp_sk(parent);
if (state & TCPF_LISTEN) {
/* MPJ subflow are removed from accept queue before reaching here,
* avoid stray wakeups
*/
if (reqsk_queue_empty(&inet_csk(sk)->icsk_accept_queue))
return;

set_bit(MPTCP_DATA_READY, &msk->flags);
parent->sk_data_ready(parent);
return;
Expand Down

0 comments on commit d1581f4

Please sign in to comment.