提交 bef34c0a 编写于 作者: M Marcel Holtmann 提交者: Gustavo Padovan

Bluetooth: Set default own address type only during controller setup

The default own address type is currently set at every power on of
a controller. This overwrites the value set via debugfs. To avoid
this issue, set the default own address type only during controller
setup.
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
上级 33337dcb
......@@ -1275,15 +1275,17 @@ static void hci_init3_req(struct hci_request *req, unsigned long opt)
hci_setup_link_policy(req);
if (lmp_le_capable(hdev)) {
/* If the controller has a public BD_ADDR, then by
* default use that one. If this is a LE only
* controller without one, default to the random
* address.
*/
if (bacmp(&hdev->bdaddr, BDADDR_ANY))
hdev->own_addr_type = ADDR_LE_DEV_PUBLIC;
else
hdev->own_addr_type = ADDR_LE_DEV_RANDOM;
if (test_bit(HCI_SETUP, &hdev->dev_flags)) {
/* If the controller has a public BD_ADDR, then
* by default use that one. If this is a LE only
* controller without a public address, default
* to the random address.
*/
if (bacmp(&hdev->bdaddr, BDADDR_ANY))
hdev->own_addr_type = ADDR_LE_DEV_PUBLIC;
else
hdev->own_addr_type = ADDR_LE_DEV_RANDOM;
}
hci_set_le_support(req);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册