summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-07-21 09:48:45 +0000
committerAmitay Isaacs <amitay@samba.org>2014-07-22 06:09:50 +0200
commit478ef9493f131c4d94bada708f790db3254f0a59 (patch)
tree15aaa74b6ea917e4214590b8fd7daeb30136c670 /ctdb
parent70c79f514024551128acc2d3ba879ef1407ed130 (diff)
downloadsamba-478ef9493f131c4d94bada708f790db3254f0a59.tar.gz
ctdb: Fix verbose_memory_names
If we have already partly written a packet, "data" and thus "pkt->data" does not point to the start of the packet anymore. Assign "hdr" while it still points at the start of the header. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Tue Jul 22 06:09:50 CEST 2014 on sn-devel-104
Diffstat (limited to 'ctdb')
-rw-r--r--ctdb/common/ctdb_io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ctdb/common/ctdb_io.c b/ctdb/common/ctdb_io.c
index 0a85f3bcd7a..b5f8a7274c4 100644
--- a/ctdb/common/ctdb_io.c
+++ b/ctdb/common/ctdb_io.c
@@ -286,6 +286,7 @@ static void queue_io_handler(struct event_context *ev, struct fd_event *fde,
*/
int ctdb_queue_send(struct ctdb_queue *queue, uint8_t *data, uint32_t length)
{
+ struct ctdb_req_header *hdr = (struct ctdb_req_header *)data;
struct ctdb_queue_pkt *pkt;
uint32_t length2, full_length;
@@ -345,7 +346,6 @@ int ctdb_queue_send(struct ctdb_queue *queue, uint8_t *data, uint32_t length)
queue->out_queue_length++;
if (queue->ctdb->tunable.verbose_memory_names != 0) {
- struct ctdb_req_header *hdr = (struct ctdb_req_header *)pkt->data;
switch (hdr->operation) {
case CTDB_REQ_CONTROL: {
struct ctdb_req_control *c = (struct ctdb_req_control *)hdr;