The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

d/remote: check for matching header value in network operation

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2567>

+13
+13
src/xrt/drivers/remote/r_hub.c
··· 416 416 r->base.get_roles = r_hub_system_devices_get_roles; 417 417 r->origin.type = XRT_TRACKING_TYPE_RGB; 418 418 r->origin.initial_offset = (struct xrt_pose)XRT_POSE_IDENTITY; 419 + r->reset.header = R_HEADER_VALUE; 419 420 r->reset.head.center = (struct xrt_pose)XRT_POSE_IDENTITY; 420 421 r->reset.head.center.position.y = 1.6f; 421 422 r->reset.left.active = true; ··· 649 650 } 650 651 } 651 652 653 + if (data->header != R_HEADER_VALUE) { 654 + RC_ERROR(rc, "Protocol version mismatch (expected 0x%08" PRIx64 ", got 0x%08" PRIx64, R_HEADER_VALUE, 655 + data->header); 656 + return -1; 657 + } 658 + 652 659 return 0; 653 660 } 654 661 ··· 657 664 { 658 665 const size_t size = sizeof(*data); 659 666 size_t current = 0; 667 + 668 + if (data->header != R_HEADER_VALUE) { 669 + RC_ERROR(rc, "Protocol version mismatch (expected 0x%08" PRIx64 ", got 0x%08" PRIx64, R_HEADER_VALUE, 670 + data->header); 671 + return -1; 672 + } 660 673 661 674 while (current < size) { 662 675 void *ptr = (uint8_t *)data + current;