You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2016/06/15 02:27:39 UTC
[17/50] [abbrv] incubator-mynewt-core git commit: Fix resolving INITA
in directed advertisement when initiating
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/af67329d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/af67329d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/af67329d
Branch: refs/heads/develop
Commit: af67329dfbc00d551d4905c42de75a4d5acfa8a0
Parents: 6695d0c
Author: William San Filippo <wi...@runtime.io>
Authored: Tue Jun 7 23:26:13 2016 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue Jun 14 19:23:35 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/af67329d/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;
}
}