bluetooth: host: Ignore HCI err 0xC when setting own addr when initiating
Ignores "command disallowed" if the host privacy implementation tries to change the device's random address while scanning or initiating. This is not allowed by spec. It's caused by scan_update() in scan.c. Signed-off-by: Olivier Lesage <olivier.lesage@nordicsemi.no>
This commit is contained in:
parent
d9d5043667
commit
063991424c
1 changed files with 6 additions and 1 deletions
|
@ -1786,7 +1786,12 @@ int bt_id_set_scan_own_addr(bool active_scan, uint8_t *own_addr_type)
|
|||
|
||||
if (IS_ENABLED(CONFIG_BT_PRIVACY)) {
|
||||
err = bt_id_set_private_addr(BT_ID_DEFAULT);
|
||||
if (err) {
|
||||
if (err == -EACCES && (atomic_test_bit(bt_dev.flags, BT_DEV_SCANNING) ||
|
||||
atomic_test_bit(bt_dev.flags, BT_DEV_INITIATING))) {
|
||||
LOG_WRN("Set random addr failure ignored in scan/init state");
|
||||
|
||||
return 0;
|
||||
} else if (err) {
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue