Skip to content

Commit 52557db

Browse files
Paolo Abenikuba-moo
authored andcommitted
mptcp: do not wakeup listener for MPJ subflows
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 by double-checking the queue state before waking the user-space. Closes: multipath-tcp/mptcp_net-next#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]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ad98dd3 commit 52557db

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

net/mptcp/subflow.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,6 +1096,12 @@ static void subflow_data_ready(struct sock *sk)
10961096

10971097
msk = mptcp_sk(parent);
10981098
if (state & TCPF_LISTEN) {
1099+
/* MPJ subflow are removed from accept queue before reaching here,
1100+
* avoid stray wakeups
1101+
*/
1102+
if (reqsk_queue_empty(&inet_csk(sk)->icsk_accept_queue))
1103+
return;
1104+
10991105
set_bit(MPTCP_DATA_READY, &msk->flags);
11001106
parent->sk_data_ready(parent);
11011107
return;

0 commit comments

Comments
 (0)