From 8cd9a94b2ff4904bc960cebb2476bf8eaa457e4b Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Fri, 3 Jan 2020 12:35:31 +0530 Subject: [PATCH] Bluetooth: controller: split: Fix controller privacy address check Fix controllers address check in cases of controller-based privacy is supported but not used to start advertising. This fixes regression introduced in commit 896619ad4075 ("Bluetooth: controller: Fix controller address check"). Signed-off-by: Vinayak Kariappa Chettimada --- subsys/bluetooth/controller/ll_sw/ull_adv.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/ull_adv.c b/subsys/bluetooth/controller/ll_sw/ull_adv.c index 4fa9896837b..115678d51b1 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_adv.c +++ b/subsys/bluetooth/controller/ll_sw/ull_adv.c @@ -468,10 +468,10 @@ u8_t ll_adv_enable(u8_t enable) /* AdvA, fill here at enable */ if (h->adv_addr) { - /* TODO: Privacy */ u8_t *tx_addr = ll_addr_get(pdu_adv->tx_addr, NULL); - if (!mem_nz(tx_addr, BDADDR_SIZE)) { + /* TODO: Privacy check */ + if (pdu_adv->tx_addr && !mem_nz(tx_addr, BDADDR_SIZE)) { return BT_HCI_ERR_INVALID_PARAM; } @@ -518,7 +518,8 @@ u8_t ll_adv_enable(u8_t enable) * found the fallback address was used instead, check * that a valid address has been set. */ - if (!mem_nz(&pdu_adv->adv_ind.addr[0], BDADDR_SIZE)) { + if (pdu_adv->tx_addr && + !mem_nz(pdu_adv->adv_ind.addr, BDADDR_SIZE)) { return BT_HCI_ERR_INVALID_PARAM; } }