summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2014-06-10 21:55:45 +0000
committerAndrew Stitcher <astitcher@apache.org>2014-06-10 21:55:45 +0000
commitf5d2190ebf6039391c5b65c9faa098352a5a07a5 (patch)
tree7725aec423e1e020710a2224e318ed2c852db5a9 /qpid/cpp/src
parent1479ba825a3ecfa76b1b77148f0b8a115e035a0f (diff)
downloadqpid-python-f5d2190ebf6039391c5b65c9faa098352a5a07a5.tar.gz
QPID-3650: Avoid unaligned memory access
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1601779 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/qpid/sys/rdma/RdmaIO.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/qpid/cpp/src/qpid/sys/rdma/RdmaIO.cpp b/qpid/cpp/src/qpid/sys/rdma/RdmaIO.cpp
index 78bcdec68e..2cc6573b74 100644
--- a/qpid/cpp/src/qpid/sys/rdma/RdmaIO.cpp
+++ b/qpid/cpp/src/qpid/sys/rdma/RdmaIO.cpp
@@ -200,7 +200,11 @@ namespace Rdma {
if (!buff) {
Buffer* ob = getSendBuffer();
// Have to send something as adapters hate it when you try to transfer 0 bytes
- *reinterpret_cast< uint32_t* >(ob->bytes()) = htonl(credit);
+ char* bytes = ob->bytes();
+ bytes[0] = 0xFF & (credit >> 24);
+ bytes[1] = 0xFF & (credit >> 16);
+ bytes[2] = 0xFF & (credit >> 8);
+ bytes[3] = 0xFF & (credit );
ob->dataCount(sizeof(uint32_t));
qp->postSend(credit | IgnoreData, ob);
} else if (credit > 0) {