summaryrefslogtreecommitdiff
path: root/net/rds
diff options
context:
space:
mode:
authorSantosh Shilimkar <santosh.shilimkar@oracle.com>2019-06-28 15:38:58 -0700
committerSantosh Shilimkar <santosh.shilimkar@oracle.com>2019-07-09 21:45:43 -0700
commitdc205a8d34228809dedab94a85a866cbb255248f (patch)
tree8c6bf605d051e5c8be774b5bf4b140b4d3d1a77c /net/rds
parentfc640d4cbe268479ba448542e2b17045c908b2b3 (diff)
rds: avoid version downgrade to legitimate newer peer connections
Connections with legitimate tos values can get into usual connection race. It can result in consumer reject. We don't want tos value or protocol version to be demoted for such connections otherwise piers would end up different tos values which can results in no connection. Example a peer initiated connection with say tos 8 while usual connection racing can get downgraded to tos 0 which is not desirable. Patch fixes above issue introduced by commit commit d021fabf525f ("rds: rdma: add consumer reject") Reported-by: Yanjun Zhu <yanjun.zhu@oracle.com> Tested-by: Yanjun Zhu <yanjun.zhu@oracle.com> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Diffstat (limited to 'net/rds')
-rw-r--r--net/rds/rdma_transport.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/rds/rdma_transport.c b/net/rds/rdma_transport.c
index 9db455d02255..ff74c4bbb9fc 100644
--- a/net/rds/rdma_transport.c
+++ b/net/rds/rdma_transport.c
@@ -117,8 +117,10 @@ static int rds_rdma_cm_event_handler_cmn(struct rdma_cm_id *cm_id,
((*err) <= RDS_RDMA_REJ_INCOMPAT))) {
pr_warn("RDS/RDMA: conn <%pI6c, %pI6c> rejected, dropping connection\n",
&conn->c_laddr, &conn->c_faddr);
- conn->c_proposed_version = RDS_PROTOCOL_COMPAT_VERSION;
- conn->c_tos = 0;
+
+ if (!conn->c_tos)
+ conn->c_proposed_version = RDS_PROTOCOL_COMPAT_VERSION;
+
rds_conn_drop(conn);
}
rdsdebug("Connection rejected: %s\n",