@@ -1179,16 +1179,19 @@ int ibv_cmd_create_ah(struct ibv_pd *pd, struct ibv_ah *ah,
IBV_INIT_CMD_RESP(&cmd, sizeof cmd, CREATE_AH, &resp, sizeof resp);
cmd.user_handle = (uintptr_t) ah;
cmd.pd_handle = pd->handle;
+ cmd.reserved = 0;
cmd.attr.dlid = attr->dlid;
cmd.attr.sl = attr->sl;
cmd.attr.src_path_bits = attr->src_path_bits;
cmd.attr.static_rate = attr->static_rate;
cmd.attr.is_global = attr->is_global;
cmd.attr.port_num = attr->port_num;
+ cmd.attr.reserved = 0;
cmd.attr.grh.flow_label = attr->grh.flow_label;
cmd.attr.grh.sgid_index = attr->grh.sgid_index;
cmd.attr.grh.hop_limit = attr->grh.hop_limit;
cmd.attr.grh.traffic_class = attr->grh.traffic_class;
+ cmd.attr.grh.reserved = 0;
memcpy(cmd.attr.grh.dgid, attr->grh.dgid.raw, 16);
if (write(pd->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
Reserved fields in struct ibv_kern_global_route, struct ibv_kern_ah_attr and struct ibv_create_ah must be properly initialized when exchanged with kernel uverbs layer, as: - it may remove valgrind spurious warnings; - it may allow to use the field later for future expansion. Link: http://marc.info/?i=cover.1412163687.git.ydroneaud@opteya.com Fixes: eb0663777c24 ('Add support for new datapath kernel commands') Signed-off-by: Yann Droneaud <ydroneaud@opteya.com> --- src/cmd.c | 3 +++ 1 file changed, 3 insertions(+)