check if eth rx packet is overflow

This commit is contained in:
sakumisu
2024-05-03 19:19:17 +08:00
parent 7ebcafe158
commit ae5a9d1e57
5 changed files with 29 additions and 9 deletions

View File

@@ -459,8 +459,8 @@ find_class:
}
}
g_rndis_rx_length = 0;
while (1) {
g_rndis_rx_length = 0;
usbh_bulk_urb_fill(&g_rndis_class.bulkin_urb, g_rndis_class.hport, g_rndis_class.bulkin, g_rndis_rx_buffer, CONFIG_USBHOST_RNDIS_ETH_MAX_RX_SIZE, USB_OSAL_WAITING_FOREVER, NULL, NULL);
ret = usbh_submit_urb(&g_rndis_class.bulkin_urb);
if (ret < 0) {
@@ -507,6 +507,10 @@ find_class:
}
}
} else {
if (g_rndis_rx_length > CONFIG_USBHOST_RNDIS_ETH_MAX_RX_SIZE) {
USB_LOG_ERR("Rx packet is overflow\r\n");
g_rndis_rx_length = 0;
}
}
}