This is an automated email from the ASF dual-hosted git repository. andk pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
commit ac1b8f65b9bf38f0d203f844a8cdae961d68cb7f Author: Andrzej Kaczmarek <[email protected]> AuthorDate: Tue Jun 30 01:30:05 2020 +0200 nimble/ll: Ignore PDUs received after scan disabled We should better ignore any PDU that was received in LL after scanner was disabled since they may not be handled as they should be. --- nimble/controller/src/ble_ll_scan.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nimble/controller/src/ble_ll_scan.c b/nimble/controller/src/ble_ll_scan.c index 930d88a..11ccbed 100644 --- a/nimble/controller/src/ble_ll_scan.c +++ b/nimble/controller/src/ble_ll_scan.c @@ -3021,7 +3021,8 @@ ble_ll_scan_rx_pkt_in_on_legacy(uint8_t pdu_type, struct os_mbuf *om, if (!BLE_MBUF_HDR_DEVMATCH(hdr) || !BLE_MBUF_HDR_CRC_OK(hdr) || - BLE_MBUF_HDR_IGNORED(hdr)) { + BLE_MBUF_HDR_IGNORED(hdr) || + !scansm->scan_enabled) { return; } @@ -3075,7 +3076,8 @@ ble_ll_scan_rx_pkt_in_on_aux(uint8_t pdu_type, struct os_mbuf *om, BLE_MBUF_HDR_IGNORED(hdr) || BLE_MBUF_HDR_AUX_INVALID(hdr) || (aux_data->flags_ll & BLE_LL_AUX_FLAG_SCAN_ERROR) || - (pdu_type != BLE_ADV_PDU_TYPE_ADV_EXT_IND)) { + (pdu_type != BLE_ADV_PDU_TYPE_ADV_EXT_IND) || + !scansm->scan_enabled) { if (aux_data) { ble_ll_scan_end_adv_evt(aux_data); ble_ll_scan_aux_data_unref(aux_data);
