Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/upf54 f4c26e280 -> e9eeb7c5a


Fix resolving INITA in directed advertisement when initiating

The code was not correctly handling the resolving of the INITA
when we were the initiator and ther advertiser was sending a
resolvable private address. The code needs to resolve the INITA
and then make sure it is our device address.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/e9eeb7c5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/e9eeb7c5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/e9eeb7c5

Branch: refs/heads/upf54
Commit: e9eeb7c5a1fc98121126e0b705e7ca2dd45a6b3e
Parents: f4c26e2
Author: William San Filippo <wi...@runtime.io>
Authored: Tue Jun 7 23:26:13 2016 -0700
Committer: William San Filippo <wi...@runtime.io>
Committed: Tue Jun 7 23:28:49 2016 -0700

----------------------------------------------------------------------
 net/nimble/controller/src/ble_ll_conn.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/e9eeb7c5/net/nimble/controller/src/ble_ll_conn.c
----------------------------------------------------------------------
diff --git a/net/nimble/controller/src/ble_ll_conn.c 
b/net/nimble/controller/src/ble_ll_conn.c
index 77d2452..7b69a65 100644
--- a/net/nimble/controller/src/ble_ll_conn.c
+++ b/net/nimble/controller/src/ble_ll_conn.c
@@ -2188,9 +2188,18 @@ ble_ll_init_rx_isr_end(struct os_mbuf *rxpdu, uint8_t 
crcok)
             inita_is_rpa = (uint8_t)ble_ll_is_rpa(init_addr, addr_type);
         }
 
-        if (!inita_is_rpa && ble_ll_is_our_devaddr(init_addr, addr_type)) {
-            /* We should not respond if we expect the device to be private */
-            if (connsm->own_addr_type <= BLE_HCI_ADV_OWN_ADDR_RANDOM) {
+        /*
+         * If we expect our address to be private and the INITA is not,
+         * we dont respond!
+         */
+        if (connsm->own_addr_type > BLE_HCI_ADV_OWN_ADDR_RANDOM) {
+            if (!inita_is_rpa) {
+                goto init_rx_isr_exit;
+            } else {
+                chk_send_req = 1;
+            }
+        } else {
+            if (ble_ll_is_our_devaddr(init_addr, addr_type)) {
                 chk_send_req = 1;
             }
         }

Reply via email to