summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2014-06-04 12:13:30 +0000
committermpi <mpi@openbsd.org>2014-06-04 12:13:30 +0000
commit5c77300749d0759783325d774c5cb9745fc7f602 (patch)
tree40b3bbe4fa4c99b0f84d9133ac462b757d6ae465
parentProperly compare endpoint addresses: ignore the direction bit which (diff)
downloadwireguard-openbsd-5c77300749d0759783325d774c5cb9745fc7f602.tar.xz
wireguard-openbsd-5c77300749d0759783325d774c5cb9745fc7f602.zip
Do not skip or add a byte for the report ID when manipulating data.
This is not compatible to our current schema where one kernel device is attached per report ID of every USB HID device since the drivers already strip the data buffers. Fix a parsing issue reported by henning@
-rw-r--r--lib/libusbhid/data.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libusbhid/data.c b/lib/libusbhid/data.c
index 38f5ea6fb50..f1b78bddf7f 100644
--- a/lib/libusbhid/data.c
+++ b/lib/libusbhid/data.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: data.c,v 1.7 2014/05/12 17:03:28 mpi Exp $ */
+/* $OpenBSD: data.c,v 1.8 2014/06/04 12:13:30 mpi Exp $ */
/* $NetBSD: data.c,v 1.1 2001/12/28 17:45:26 augustss Exp $ */
/*
@@ -41,9 +41,11 @@ hid_get_data(const void *p, const hid_item_t *h)
buf = p;
+#if 0
/* Skip report ID byte. */
if (h->report_ID > 0)
buf++;
+#endif
hpos = h->pos; /* bit position of data */
hsize = h->report_size; /* bit length of data */
@@ -86,9 +88,11 @@ hid_set_data(void *p, const hid_item_t *h, int32_t data)
buf = p;
+#if 0
/* Set report ID byte. */
if (h->report_ID > 0)
*buf++ = h->report_ID & 0xff;
+#endif
hpos = h->pos; /* bit position of data */
hsize = h->report_size; /* bit length of data */