Skip to content

Commit

Permalink
Bluetooth: Controller: Fix incorrect common header length calc
Browse files Browse the repository at this point in the history
Fix incorrect calculation of received common extended header
length. Due to this a zero length advertising data is
reported in Extended Advertising and Periodic Advertising
report as one byte AD data.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
  • Loading branch information
cvinayak authored and carlescufi committed Sep 16, 2021
1 parent 0f9533e commit 380a800
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions subsys/bluetooth/controller/hci/hci.c
Original file line number Diff line number Diff line change
Expand Up @@ -5216,12 +5216,6 @@ static void le_ext_adv_report(struct pdu_data *pdu_data,
}

hdr_len = ptr - (uint8_t *)p;
if (hdr_len <= (PDU_AC_EXT_HEADER_SIZE_MIN +
sizeof(struct pdu_adv_ext_hdr))) {
hdr_len = PDU_AC_EXT_HEADER_SIZE_MIN;
ptr = (uint8_t *)h;
}

hdr_buf_len = PDU_AC_EXT_HEADER_SIZE_MIN + p->ext_hdr_len;
if (hdr_len > hdr_buf_len) {
BT_WARN(" Header length %u/%u, INVALID.", hdr_len,
Expand Down Expand Up @@ -5639,12 +5633,6 @@ static void le_per_adv_sync_report(struct pdu_data *pdu_data,
}

hdr_len = ptr - (uint8_t *)p;
if (hdr_len <= (PDU_AC_EXT_HEADER_SIZE_MIN +
sizeof(struct pdu_adv_ext_hdr))) {
hdr_len = PDU_AC_EXT_HEADER_SIZE_MIN;
ptr = (uint8_t *)h;
}

hdr_buf_len = PDU_AC_EXT_HEADER_SIZE_MIN + p->ext_hdr_len;
if (hdr_len > hdr_buf_len) {
BT_WARN(" Header length %u/%u, INVALID.", hdr_len,
Expand Down

0 comments on commit 380a800

Please sign in to comment.