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 9331fbc5 nimble/ll: Fix own address type check during scan
9331fbc5 is described below

commit 9331fbc5a435c32512f7f6ad452cf16ae2b720e8
Author: Andrzej Kaczmarek <[email protected]>
AuthorDate: Fri Aug 19 13:41:01 2022 +0200

    nimble/ll: Fix own address type check during scan
    
    We did not check own address type requested for scan when filtering so
    we matched random address even if public address was requested and vv.
    
    This fixes LL/DDI/SCN/BV-71-C.
---
 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 4893b2b0..010fe150 100644
--- a/nimble/controller/src/ble_ll_scan.c
+++ b/nimble/controller/src/ble_ll_scan.c
@@ -1333,7 +1333,8 @@ ble_ll_scan_rx_filter(uint8_t own_addr_type, uint8_t 
scan_filt_policy,
             }
 
             /* Ignore if not directed to us */
-            if (!ble_ll_is_our_devaddr(addrd->targeta, addrd->targeta_type)) {
+            if ((addrd->targeta_type != (own_addr_type & 0x01)) ||
+                !ble_ll_is_our_devaddr(addrd->targeta, addrd->targeta_type)) {
                 return -1;
             }
             break;
@@ -1347,7 +1348,8 @@ ble_ll_scan_rx_filter(uint8_t own_addr_type, uint8_t 
scan_filt_policy,
 #else
     /* Ignore if not directed to us */
     if (addrd->targeta &&
-        !ble_ll_is_our_devaddr(addrd->targeta, addrd->targeta_type)) {
+        ((addrd->targeta_type != (own_addr_type & 0x01)) ||
+         !ble_ll_is_our_devaddr(addrd->targeta, addrd->targeta_type))) {
         return -1;
     }
 

Reply via email to