jiegec / usbip

A Rust library to run a USB/IP server
MIT License
255 stars 25 forks source link

usbip_protocol: fix parser bug on cmd_submit and ret_submit #37

Closed h7x4 closed 6 months ago

h7x4 commented 6 months ago

This PR fixes a critical error in the usbip protocol parser.

From https://docs.kernel.org/usb/usbip_protocol.html (USBIP_CMD_SUBMIT, USBIP_RET_SUBMIT)

0x30 - n - transfer_buffer. If direction is USBIP_DIR_OUT then n equals transfer_buffer_length; otherwise n equals 0. For ISO transfers the padding between each ISO packets is not transmitted.

0x30 - n - transfer_buffer. If direction is USBIP_DIR_IN then n equals actual_length; otherwise n equals 0. For ISO transfers the padding between each ISO packets is not transmitted.

Closes #36