From a6b978b1f2666b46fee87aa25e3463e82e6bb5bd Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Thu, 30 Jan 2020 17:29:58 +0100 Subject: [PATCH] Bluetooth: host: Drop directed adv reports for NRPA passive scanner Drop directed advertiser reports when the passive scanner should have been using the NRPA address. The advertiser has overwritten the NRPA with it's identity address instead and a peer is sending directed advertiser packets to it. Signed-off-by: Joakim Andersson --- subsys/bluetooth/host/hci_core.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 98891d67032..b44f1ca2a70 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -3787,6 +3787,14 @@ static void le_adv_report(struct net_buf *buf) info = net_buf_pull_mem(buf, sizeof(*info)); rssi = info->data[info->length]; + if (!IS_ENABLED(CONFIG_BT_PRIVACY) && + !IS_ENABLED(CONFIG_BT_SCAN_WITH_IDENTITY) && + atomic_test_bit(bt_dev.flags, BT_DEV_EXPLICIT_SCAN) && + info->evt_type == BT_LE_ADV_DIRECT_IND) { + BT_DBG("Dropped direct adv report"); + continue; + } + BT_DBG("%s event %u, len %u, rssi %d dBm", bt_addr_le_str(&info->addr), info->evt_type, info->length, rssi);