Skip to content

Commit c948bb5

Browse files
sowminivdavem330
authored andcommitted
RDS: TCP: Avoid rds connection churn from rogue SYNs
When a rogue SYN is received after the connection arbitration algorithm has converged, the incoming SYN should not needlessly quiesce the transmit path, and it should not result in needless TCP connection resets due to re-execution of the connection arbitration logic. Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 37e14f4 commit c948bb5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

net/rds/tcp_listen.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,13 @@ int rds_tcp_accept_one(struct socket *sock)
132132
* so we must quiesce any send threads before resetting
133133
* c_transport_data.
134134
*/
135-
wait_event(conn->c_waitq,
136-
!test_bit(RDS_IN_XMIT, &conn->c_flags));
137-
if (ntohl(inet->inet_saddr) < ntohl(inet->inet_daddr)) {
135+
if (ntohl(inet->inet_saddr) < ntohl(inet->inet_daddr) ||
136+
!conn->c_outgoing) {
138137
goto rst_nsk;
139-
} else if (rs_tcp->t_sock) {
138+
} else {
139+
atomic_set(&conn->c_state, RDS_CONN_CONNECTING);
140+
wait_event(conn->c_waitq,
141+
!test_bit(RDS_IN_XMIT, &conn->c_flags));
140142
rds_tcp_restore_callbacks(rs_tcp->t_sock, rs_tcp);
141143
conn->c_outgoing = 0;
142144
}

0 commit comments

Comments
 (0)