Skip to content

Commit eecf6fb

Browse files
ncasarilkasjer
authored andcommitted
transport/usb: Fix len comparison to allow fragmented acl
The comparison previously always triggered on the first fragment received as the expected length (len) is always larger or equal to the total received length (om_len). Partly addresses apache#940.
1 parent 32621d0 commit eecf6fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nimble/transport/usb/src/ble_hci_usb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ tud_bt_acl_data_received_cb(void *acl_data, uint16_t data_len)
211211
if (om->om_len > BLE_HCI_DATA_HDR_SZ) {
212212
data = incoming_acl_data->om_data;
213213
len = data[2] + (data[3] << 8) + BLE_HCI_DATA_HDR_SZ;
214-
if (len >= incoming_acl_data->om_len) {
214+
if (incoming_acl_data->om_len >= len) {
215215
incoming_acl_data = NULL;
216216
rc = ble_hci_usb_rx_acl_ll_cb(om, ble_hci_usb_rx_acl_ll_arg);
217217
(void)rc;

0 commit comments

Comments
 (0)