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
The following commit(s) were added to refs/heads/master by this push:
new 7df6d2040 nimble/ll: Fix sync check in aux
7df6d2040 is described below
commit 7df6d20409a60a0369c1db852dd79f2cbe3d56cd
Author: Andrzej Kaczmarek <[email protected]>
AuthorDate: Wed Feb 26 01:50:41 2025 +0100
nimble/ll: Fix sync check in aux
This fixes condition to check if AUX_ADV_IND has both ADI and SyncInfo
before passing it to sync code.
Invalid condition allowed that either ADI *or* SyncInfo is present in
whch case the offset to SyncInfo in PDU was calculated incorrectly and
the resulting sync sm used random data and thus failed.
---
nimble/controller/src/ble_ll_scan_aux.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/nimble/controller/src/ble_ll_scan_aux.c
b/nimble/controller/src/ble_ll_scan_aux.c
index 0596cd6f9..ceb094c02 100644
--- a/nimble/controller/src/ble_ll_scan_aux.c
+++ b/nimble/controller/src/ble_ll_scan_aux.c
@@ -1412,8 +1412,8 @@ ble_ll_scan_aux_sync_check(struct os_mbuf *rxpdu,
eh_data = &rxbuf[4];
/* Need ADI and SyncInfo */
- if (!(eh_flags & ((1 << BLE_LL_EXT_ADV_SYNC_INFO_BIT) |
- (1 << BLE_LL_EXT_ADV_DATA_INFO_BIT)))) {
+ if (!(eh_flags & (1 << BLE_LL_EXT_ADV_DATA_INFO_BIT)) ||
+ !(eh_flags & (1 << BLE_LL_EXT_ADV_SYNC_INFO_BIT))) {
return;
}