mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-08-28 04:40:05 +00:00
nimble/ll: Drop packets with empty payload for LL Control PDU
Only continuation/empty LL Data PDU can have empty payload. Reference: Core v5.0, Vol 6, Part B, section 2.4 X-Original-Commit: dfa5d749cc1f9573e375589abbce00a906b8b8c1
This commit is contained in:
@@ -3442,9 +3442,12 @@ ble_ll_conn_rx_data_pdu(struct os_mbuf *rxpdu, struct ble_mbuf_hdr *hdr)
|
||||
acl_len = rxbuf[1];
|
||||
acl_hdr = hdr_byte & BLE_LL_DATA_HDR_LLID_MASK;
|
||||
|
||||
/* Check that the LLID is reasonable */
|
||||
/*
|
||||
* Check that the LLID and payload length are reasonable.
|
||||
* Empty payload is only allowed for LLID == 01b.
|
||||
* */
|
||||
if ((acl_hdr == 0) ||
|
||||
((acl_hdr == BLE_LL_LLID_DATA_START) && (acl_len == 0))) {
|
||||
((acl_len == 0) && (acl_hdr != BLE_LL_LLID_DATA_FRAG))) {
|
||||
STATS_INC(ble_ll_conn_stats, rx_bad_llid);
|
||||
goto conn_rx_data_pdu_end;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user