Gitweb:
http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: b87c913695c90af199b2335bdc5d117f658cd132
Parent: ef03894f10f1ffc51422dd89a310e887c043e543
Author: Ryan McCabe <rmccabe(a)redhat.com>
AuthorDate: Wed Apr 25 21:23:21 2012 -0400
Committer: Ryan McCabe <rmccabe(a)redhat.com>
CommitterDate: Tue May 1 11:00:22 2012 -0400
Copy lock messages before swapping bytes because we may use the lock message struct again
after calling send_lock_msg()
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
Reviewed-by: Lon Hohberger <lhh(a)redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
rgmanager/src/daemons/cpglockd.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/rgmanager/src/daemons/cpglockd.c b/rgmanager/src/daemons/cpglockd.c
index df18eb3..fa40e98 100644
--- a/rgmanager/src/daemons/cpglockd.c
+++ b/rgmanager/src/daemons/cpglockd.c
@@ -427,11 +427,13 @@ send_lock_msg(struct cpg_lock_msg *m)
{
struct iovec iov;
int ret;
+ struct cpg_lock_msg out_msg;
- swab_cpg_lock_msg(m);
+ memcpy(&out_msg, m, sizeof(out_msg));
+ swab_cpg_lock_msg(&out_msg);
- iov.iov_base = m;
- iov.iov_len = sizeof (*m);
+ iov.iov_base = &out_msg;
+ iov.iov_len = sizeof(out_msg);
do {
ret = cpg_mcast_joined(cpg, CPG_TYPE_AGREED, &iov, 1);