Hi Johan, > If privacy is enabled we'll be using RPAs instead of the static address. > Therefore, only write the static address to HCI when the HCI_PRIVACY > flag is not set. > > Signed-off-by: Johan Hedberg <johan.hedberg@xxxxxxxxx> > --- > net/bluetooth/mgmt.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c > index 145254f84975..21d059968c32 100644 > --- a/net/bluetooth/mgmt.c > +++ b/net/bluetooth/mgmt.c > @@ -4609,7 +4609,8 @@ static int powered_update_hci(struct hci_dev *hdev) > > if (lmp_le_capable(hdev)) { > /* Set random address to static address if configured */ > - if (bacmp(&hdev->static_addr, BDADDR_ANY)) > + if (!test_bit(HCI_PRIVACY, &hdev->dev_flags) && > + bacmp(&hdev->static_addr, BDADDR_ANY)) > hci_req_add(&req, HCI_OP_LE_SET_RANDOM_ADDR, 6, > &hdev->static_addr); since we are changing to code to always write the random address before enabling scanning, before enabling advertising and before creating a connection, lets remove this support here completely. If we are not using privacy and have a static address, lets write it before it gets used. I added tracing of the currently configured random address. So we always know when we have to update the address itself or not. That makes it a bit more error free and gives us less headaches to figure static vs RPA. Regards Marcel -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html