Bluetooth: controller: split: Fix initialization of new aux header

Fix missing implementation of initialization of common
advertising header bit fields when new auxiliary channel PDU
is instantiated. This caused corrupt invalid Bluetooth
Device address being copied from uninitialised previous
auxiliary PDU instead of copying from primary channel PDU.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
Vinayak Kariappa Chettimada 2020-05-19 09:10:03 +05:30 committed by Carles Cufí
commit 3d78a16d81

View file

@ -94,8 +94,9 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, ui
struct lll_adv_aux *lll_aux;
struct ll_adv_aux_set *aux;
struct ll_adv_set *adv;
struct lll_adv *lll;
uint8_t pri_idx, sec_idx;
struct lll_adv *lll;
uint8_t is_aux_new;
/* op param definitions:
* 0x00 - Intermediate fragment of fragmented extended advertising data
@ -144,9 +145,13 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, ui
/* NOTE: ull_hdr_init(&aux->ull); is done on start */
lll_hdr_init(lll_aux, aux);
aux->is_started = 0;
aux->is_started = 0U;
is_aux_new = 1U;
} else {
aux = (void *)HDR_LLL2EVT(lll_aux);
is_aux_new = 0U;
}
/* Get reference to previous primary PDU data */
@ -170,7 +175,11 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, ui
sec_pdu_prev = lll_adv_aux_data_peek(lll_aux);
sec_com_hdr_prev = (void *)&sec_pdu_prev->adv_ext_ind;
sec_hdr = (void *)sec_com_hdr_prev->ext_hdr_adi_adv_data;
sec_hdr_prev = *sec_hdr;
if (!is_aux_new) {
sec_hdr_prev = *sec_hdr;
} else {
*(uint8_t *)&sec_hdr_prev = 0U;
}
sec_dptr_prev = (uint8_t *)sec_hdr + sizeof(*sec_hdr);
/* Get reference to new secondary PDU data buffer */