tcp: Drop EPOLLOUT for connections being established earlier
That's the first thing we have to do, before sending SYN, ACK: if tcp_send_to_tap() fails, we'll get a lot of useless events otherwise. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
a909fd5e7a
commit
ccbf13ed1b
1 changed files with 3 additions and 3 deletions
6
tcp.c
6
tcp.c
|
@ -2656,6 +2656,9 @@ static void tcp_connect_finish(struct ctx *c, struct tcp_tap_conn *conn,
|
|||
socklen_t sl;
|
||||
int so;
|
||||
|
||||
/* Drop EPOLLOUT, only used to wait for connect() to complete */
|
||||
tcp_tap_epoll_mask(c, conn, EPOLLIN | EPOLLRDHUP);
|
||||
|
||||
sl = sizeof(so);
|
||||
if (getsockopt(conn->sock, SOL_SOCKET, SO_ERROR, &so, &sl) || so) {
|
||||
tcp_rst(c, conn);
|
||||
|
@ -2665,9 +2668,6 @@ static void tcp_connect_finish(struct ctx *c, struct tcp_tap_conn *conn,
|
|||
if (tcp_send_to_tap(c, conn, SYN | ACK, now))
|
||||
return;
|
||||
|
||||
/* Drop EPOLLOUT, only used to wait for connect() to complete */
|
||||
tcp_tap_epoll_mask(c, conn, EPOLLIN | EPOLLRDHUP);
|
||||
|
||||
tcp_tap_state(conn, TAP_SYN_RCVD);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue