1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

ctdb-protocol: Fix marshalling for GET_DB_SEQNUM control request

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12259

Even though database id is 32-bit, it's sent on wire as 64-bits.
The database id is the first 32-bits on the wire.  This needs fixing
eventually, but for now keep the same wire format.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
Amitay Isaacs 2016-09-13 16:05:14 +10:00 committed by Martin Schwenke
parent b0dadbee33
commit bdff6255af

View File

@ -49,7 +49,6 @@ struct ctdb_reply_control_wire {
static size_t ctdb_req_control_data_len(struct ctdb_req_control_data *cd)
{
size_t len = 0;
uint64_t u64;
if (cd == NULL) {
return 0;
@ -335,8 +334,7 @@ static size_t ctdb_req_control_data_len(struct ctdb_req_control_data *cd)
break;
case CTDB_CONTROL_GET_DB_SEQNUM:
u64 = cd->data.db_id;
len = ctdb_uint64_len(u64);
len = ctdb_uint64_len((uint64_t)cd->data.db_id);
break;
case CTDB_CONTROL_DB_SET_HEALTHY:
@ -452,8 +450,6 @@ static size_t ctdb_req_control_data_len(struct ctdb_req_control_data *cd)
static void ctdb_req_control_data_push(struct ctdb_req_control_data *cd,
uint8_t *buf)
{
uint64_t u64;
switch (cd->opcode) {
case CTDB_CONTROL_PROCESS_EXISTS:
ctdb_pid_push(cd->data.pid, buf);
@ -635,8 +631,7 @@ static void ctdb_req_control_data_push(struct ctdb_req_control_data *cd,
break;
case CTDB_CONTROL_GET_DB_SEQNUM:
u64 = cd->data.db_id;
ctdb_uint64_push(u64, buf);
ctdb_uint32_push(cd->data.db_id, buf);
break;
case CTDB_CONTROL_DB_SET_HEALTHY:
@ -735,7 +730,6 @@ static int ctdb_req_control_data_pull(uint8_t *buf, size_t buflen,
struct ctdb_req_control_data *cd)
{
int ret = 0;
uint64_t u64 = 0;
cd->opcode = opcode;
@ -964,8 +958,8 @@ static int ctdb_req_control_data_pull(uint8_t *buf, size_t buflen,
break;
case CTDB_CONTROL_GET_DB_SEQNUM:
ret = ctdb_uint64_pull(buf, buflen, mem_ctx, &u64);
cd->data.db_id = (uint32_t)u64;
ret = ctdb_uint32_pull(buf, buflen, mem_ctx,
&cd->data.db_id);
break;
case CTDB_CONTROL_DB_SET_HEALTHY: