DBG("version %u revision %u", mgmt_version, mgmt_revision);
memset(&hdr, 0, sizeof(hdr));
- hdr.opcode = MGMT_OP_READ_INDEX_LIST;
+ hdr.opcode = htobs(MGMT_OP_READ_INDEX_LIST);
if (write(sk, &hdr, sizeof(hdr)) < 0)
error("Unable to read controller index list: %s (%d)",
strerror(errno), errno);
struct mgmt_cp_read_info *cp = (void *) &buf[sizeof(*hdr)];
memset(buf, 0, sizeof(buf));
- hdr->opcode = MGMT_OP_READ_INFO;
+ hdr->opcode = htobs(MGMT_OP_READ_INFO);
hdr->len = htobs(sizeof(*cp));
cp->index = htobs(index);
struct mgmt_mode *cp = (void *) &buf[sizeof(*hdr)];
memset(buf, 0, sizeof(buf));
- hdr->opcode = opcode;
+ hdr->opcode = htobs(opcode);
hdr->len = htobs(sizeof(*cp));
cp->index = htobs(index);
uuid_to_uuid128(&uuid128, uuid);
memset(buf, 0, sizeof(buf));
- hdr->opcode = op;
+ hdr->opcode = htobs(op);
hdr->len = htobs(sizeof(*cp));
cp->index = htobs(index);
}
memset(&hdr, 0, sizeof(hdr));
- hdr.opcode = MGMT_OP_READ_VERSION;
+ hdr.opcode = htobs(MGMT_OP_READ_VERSION);
if (write(dd, &hdr, sizeof(hdr)) < 0) {
err = -errno;
goto fail;