summaryrefslogtreecommitdiff
path: root/cpp
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
commit01f04fd3edb86ec69e1e1cee977a5b069ddfcd04 (patch)
tree7938ecd26ab230468d18b7138bffa1b5fce7e688 /cpp
parent5c1b2fc5e3070b884893937f2079ecda6deee107 (diff)
downloadqpid-python-01f04fd3edb86ec69e1e1cee977a5b069ddfcd04.tar.gz
QPID-3650: Avoid unaligned memory access
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1601779 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/qpid/sys/rdma/RdmaIO.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/cpp/src/qpid/sys/rdma/RdmaIO.cpp b/cpp/src/qpid/sys/rdma/RdmaIO.cpp
index 78bcdec68e..2cc6573b74 100644
--- a/cpp/src/qpid/sys/rdma/RdmaIO.cpp
+++ b/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) {