From a53abedcfaec2d4cb5111aaa1be2698ebd556499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Sat, 16 May 2026 17:19:31 +0800 Subject: [PATCH] usbip: cap iso packet count at linux USBIP_MAX_ISO_PACKETS The accepted limit of 4096 was looser than Linux's hard cap of 1024 in drivers/usb/usbip/usbip_common.h, so a real peer would reject submits we considered valid. Tighten the validator to 1024 to match upstream before multi-packet iso lands. --- service/usbip/data_protocol.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/service/usbip/data_protocol.go b/service/usbip/data_protocol.go index 9ec05d02b..8d82d72cb 100644 --- a/service/usbip/data_protocol.go +++ b/service/usbip/data_protocol.go @@ -22,10 +22,11 @@ const ( unlinkBodySize = 28 isoPacketDescriptorWireSize = 16 maxUSBIPTransferBufferLength = 16 << 20 - maxUSBIPIsoPackets = 4096 - nonIsoPacketCount = -1 - usbipTransferFlagIsoASAP = 0x0002 - usbipStatusECONNRESET = -104 + // matches Linux drivers/usb/usbip/usbip_common.h USBIP_MAX_ISO_PACKETS + maxUSBIPIsoPackets = 1024 + nonIsoPacketCount = -1 + usbipTransferFlagIsoASAP = 0x0002 + usbipStatusECONNRESET = -104 ) type DataHeader struct {