summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2010-12-23 17:09:12 +0000
committerAndrew Stitcher <astitcher@apache.org>2010-12-23 17:09:12 +0000
commitc2920778bacd379b1d51fe8938d83cfe36e185a3 (patch)
treebd8744e8d965a225fe9a2570edfade7baea4d0e8 /qpid/cpp/src
parent0758933d80a5aa23c69735b7aa0c3100495c4b2f (diff)
downloadqpid-python-c2920778bacd379b1d51fe8938d83cfe36e185a3.tar.gz
Allow for the case where we get an rdma reject because there is no one listening
on the resolved address git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1052326 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/qpid/sys/rdma/RdmaIO.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/qpid/cpp/src/qpid/sys/rdma/RdmaIO.cpp b/qpid/cpp/src/qpid/sys/rdma/RdmaIO.cpp
index e082fdc416..b5cedf3d70 100644
--- a/qpid/cpp/src/qpid/sys/rdma/RdmaIO.cpp
+++ b/qpid/cpp/src/qpid/sys/rdma/RdmaIO.cpp
@@ -634,10 +634,20 @@ namespace Rdma {
break;
case RDMA_CM_EVENT_REJECTED: {
// CONNECTING
- // Extract private data from event
- assert(conn_param.private_data && conn_param.private_data_len >= sizeof(NConnectionParams));
- const NConnectionParams* rcp = static_cast<const NConnectionParams*>(conn_param.private_data);
- ConnectionParams cp = *rcp;
+
+ // We can get this event if our peer is not running on the other side
+ // in this case we could get nearly anything in the private data:
+ // From private_data == 0 && private_data_len == 0 (Chelsio iWarp)
+ // to 148 bytes of zeros (Mellanox IB)
+ //
+ // So assume that if the the private data is absent or not the size of
+ // the connection parameters it isn't valid
+ ConnectionParams cp(0, 0, 0);
+ if (conn_param.private_data && conn_param.private_data_len == sizeof(NConnectionParams)) {
+ // Extract private data from event
+ const NConnectionParams* rcp = static_cast<const NConnectionParams*>(conn_param.private_data);
+ cp = *rcp;
+ }
rejectedCallback(ci, cp);
break;
}