diff --git a/plugins/mgmtops.c b/plugins/mgmtops.c
index 3aca861..65b32e6 100644
--- a/plugins/mgmtops.c
+++ b/plugins/mgmtops.c
struct mgmt_hdr *hdr = (void *) buf;
struct mgmt_cp_add_uuid *cp = (void *) &buf[sizeof(*hdr)];
uuid_t uuid128;
+ uint128_t uint128;
DBG("index %d", index);
hdr->len = htobs(sizeof(*cp));
hdr->index = htobs(index);
- memcpy(cp->uuid, uuid128.value.uuid128.data, 16);
+ ntoh128((uint128_t *) uuid128.value.uuid128.data, &uint128);
+ htob128(&uint128, (uint128_t *) cp->uuid);
+
cp->svc_hint = svc_hint;
if (write(mgmt_sock, buf, sizeof(buf)) < 0)
struct mgmt_hdr *hdr = (void *) buf;
struct mgmt_cp_remove_uuid *cp = (void *) &buf[sizeof(*hdr)];
uuid_t uuid128;
+ uint128_t uint128;
DBG("index %d", index);
hdr->len = htobs(sizeof(*cp));
hdr->index = htobs(index);
- memcpy(cp->uuid, uuid128.value.uuid128.data, 16);
+ ntoh128((uint128_t *) uuid128.value.uuid128.data, &uint128);
+ htob128(&uint128, (uint128_t *) cp->uuid);
if (write(mgmt_sock, buf, sizeof(buf)) < 0)
return -errno;