Bluetooth: Fix not generating RPA when required
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 2 Aug 2021 23:56:19 +0000 (16:56 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 3 Aug 2021 21:30:50 +0000 (23:30 +0200)
commitc45074d68a9b1e893d86520af71fab37693c3d7e
treee160aa1fcac3d4dd27fdceb63ed1d5946b47839d
parent102793136ce9dacae77c2d1f8dd6878b480f4b95
Bluetooth: Fix not generating RPA when required

Code was checking if random_addr and hdev->rpa match without first
checking if the RPA has not been set (BDADDR_ANY), furthermore it was
clearing HCI_RPA_EXPIRED before the command completes and the RPA is
actually programmed which in case of failure would leave the expired
RPA still set.

Since advertising instance have a similar problem the clearing of
HCI_RPA_EXPIRED has been moved to hci_event.c after checking the random
address is in fact the hdev->rap and then proceed to set the expire
timeout.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
include/net/bluetooth/hci_core.h
net/bluetooth/hci_event.c
net/bluetooth/hci_request.c