PDUs are padded to 8 byte boundary. If padding is used, memset it to 0
to keep valgrind happy.
struct ctdb_req_control {
struct ctdb_req_header hdr;
uint32_t opcode;
+ uint32_t pad;
uint64_t srvid;
uint32_t client_id;
#define CTDB_CTRL_FLAG_NOREPLY 1
CTDB_REQ_CONTROL, destnode, new_reqid(ctdb));
pkt = req->hdr.control;
+ pkt->pad = 0;
pkt->opcode = opcode;
pkt->srvid = 0;
pkt->client_id = 0;
along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <sys/types.h>
+#include <string.h>
#include <stdint.h>
#include <stdbool.h>
#include <unistd.h>
struct io_elem *new_io_elem(size_t len)
{
struct io_elem *elem;
+ size_t ask = len;
+
len = (len + (CTDB_DS_ALIGNMENT-1)) & ~(CTDB_DS_ALIGNMENT-1);
elem = malloc(sizeof(*elem));
return NULL;
}
+ /* stamp out any padding to keep valgrind happy */
+ if (ask != len) {
+ memset(elem->data + ask, 0, len-ask);
+ }
elem->len = len;
elem->off = 0;
return elem;