mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-08-13 21:47:53 +00:00
nimble/transport/socket: Drop too big HCI events
If received H4 event is too big for configured mempool just drop it.
This commit is contained in:
@@ -438,6 +438,15 @@ ble_hci_sock_rx_msg(void)
|
||||
}
|
||||
STATS_INC(hci_sock_stats, imsg);
|
||||
STATS_INC(hci_sock_stats, ievt);
|
||||
|
||||
/* There isn't much we can do if received event is too big */
|
||||
if (len - 1 > MYNEWT_VAL(BLE_TRANSPORT_EVT_SIZE)) {
|
||||
STATS_INC(hci_sock_stats, ierr);
|
||||
dprintf(1, "Too big HCI event (%d > %d), ignoring\n", len - 1,
|
||||
MYNEWT_VAL(BLE_TRANSPORT_EVT_SIZE));
|
||||
return -1;
|
||||
}
|
||||
|
||||
data = ble_transport_alloc_evt(0);
|
||||
if (!data) {
|
||||
STATS_INC(hci_sock_stats, ierr);
|
||||
|
||||
Reference in New Issue
Block a user