Skip to content

Commit a42cf9d

Browse files
bhesmanskuba-moo
authored andcommitted
mptcp: poll allow write call before actual connect
If fastopen is used, poll must allow a first write that will trigger the SYN+data Similar to what is done in tcp_poll(). Acked-by: Paolo Abeni <[email protected]> Reviewed-by: Matthieu Baerts <[email protected]> Signed-off-by: Benjamin Hesmans <[email protected]> Signed-off-by: Mat Martineau <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent d98a82a commit a42cf9d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

net/mptcp/protocol.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3548,6 +3548,7 @@ static int mptcp_stream_connect(struct socket *sock, struct sockaddr *uaddr,
35483548

35493549
do_connect:
35503550
err = ssock->ops->connect(ssock, uaddr, addr_len, flags);
3551+
inet_sk(sock->sk)->defer_connect = inet_sk(ssock->sk)->defer_connect;
35513552
sock->state = ssock->state;
35523553

35533554
/* on successful connect, the msk state will be moved to established by
@@ -3698,6 +3699,9 @@ static __poll_t mptcp_poll(struct file *file, struct socket *sock,
36983699
if (state != TCP_SYN_SENT && state != TCP_SYN_RECV) {
36993700
mask |= mptcp_check_readable(msk);
37003701
mask |= mptcp_check_writeable(msk);
3702+
} else if (state == TCP_SYN_SENT && inet_sk(sk)->defer_connect) {
3703+
/* cf tcp_poll() note about TFO */
3704+
mask |= EPOLLOUT | EPOLLWRNORM;
37013705
}
37023706
if (sk->sk_shutdown == SHUTDOWN_MASK || state == TCP_CLOSE)
37033707
mask |= EPOLLHUP;

0 commit comments

Comments
 (0)