- __u64 ne_off;
- int err = 0;
-
- ne_off = HTON__u64(off);
- id = HTON__u64(id);
- if (memcmp(addr, (char *)&ne_off, LPDS)) {
- CERROR("%s: for offset "LPU64" off: "LPX64" != "LPX64"\n",
- who, off, *(__u64 *)addr, ne_off);
- err = -EINVAL;
- }
- if (memcmp(addr + LPDS, (char *)&id, LPDS)) {
- CERROR("%s: for offset "LPU64" id: "LPX64" != "LPX64"\n",
- who, off, *(__u64 *)(addr + LPDS), id);
- err = -EINVAL;
- }
-
- addr += size - LPDS - LPDS;
- if (memcmp(addr, (char *)&ne_off, LPDS)) {
- CERROR("%s: for offset "LPU64" end off: "LPX64" != "LPX64"\n",
- who, off, *(__u64 *)addr, ne_off);
- err = -EINVAL;
- }
- if (memcmp(addr + LPDS, (char *)&id, LPDS)) {
- CERROR("%s: for offset "LPU64" end id: "LPX64" != "LPX64"\n",
- who, off, *(__u64 *)(addr + LPDS), id);
- err = -EINVAL;
- }
-
- return err;
+ uint64_t ne_off;
+ int err = 0;
+
+ ne_off = le64toh(off);
+ id = le64toh(id);
+ if (memcmp(addr, (char *)&ne_off, LPDS)) {
+ fprintf(stderr, "%s: for offset %"PRIu64" off: %"PRIx64" != %"PRIx64"\n",
+ who, off, *(uint64_t *)addr, ne_off);
+ err = -EINVAL;
+ }
+ if (memcmp(addr + LPDS, (char *)&id, LPDS)) {
+ fprintf(stderr, "%s: for offset %"PRIu64" id: %"PRIx64" != %"PRIx64"\n",
+ who, off, *(uint64_t *)(addr + LPDS), id);
+ err = -EINVAL;
+ }
+
+ addr += size - LPDS - LPDS;
+ if (memcmp(addr, (char *)&ne_off, LPDS)) {
+ fprintf(stderr, "%s: for offset %"PRIu64" end off: %"PRIx64" != %"PRIx64"\n",
+ who, off, *(uint64_t *)addr, ne_off);
+ err = -EINVAL;
+ }
+ if (memcmp(addr + LPDS, (char *)&id, LPDS)) {
+ fprintf(stderr, "%s: for offset %"PRIu64" end id: %"PRIx64" != %"PRIx64"\n",
+ who, off, *(uint64_t *)(addr + LPDS), id);
+ err = -EINVAL;
+ }
+
+ return err;