diff options
Diffstat (limited to 'net/rds/tcp_connect.c')
| -rw-r--r-- | net/rds/tcp_connect.c | 14 | 
1 files changed, 13 insertions, 1 deletions
diff --git a/net/rds/tcp_connect.c b/net/rds/tcp_connect.c index 05f61c533ed3..d6839d96d539 100644 --- a/net/rds/tcp_connect.c +++ b/net/rds/tcp_connect.c @@ -60,7 +60,19 @@ void rds_tcp_state_change(struct sock *sk)  	case TCP_SYN_RECV:  		break;  	case TCP_ESTABLISHED: -		rds_connect_path_complete(cp, RDS_CONN_CONNECTING); +		/* Force the peer to reconnect so that we have the +		 * TCP ports going from <smaller-ip>.<transient> to +		 * <larger-ip>.<RDS_TCP_PORT>. We avoid marking the +		 * RDS connection as RDS_CONN_UP until the reconnect, +		 * to avoid RDS datagram loss. +		 */ +		if (cp->cp_conn->c_laddr > cp->cp_conn->c_faddr && +		    rds_conn_path_transition(cp, RDS_CONN_CONNECTING, +					     RDS_CONN_ERROR)) { +			rds_conn_path_drop(cp); +		} else { +			rds_connect_path_complete(cp, RDS_CONN_CONNECTING); +		}  		break;  	case TCP_CLOSE_WAIT:  	case TCP_CLOSE:  |