When Experimental LL_Privacy enabled & Privacy is set to device mode the pairing of 2 linux devices fails with authentication failure error. This happens only on the 2nd attempt when we swap the advertiser/initiator role. This is because the init_addr is updated with dev->rpa which still holds the previous connection RPA. This patch fixes the issue when ll_privacy is enabled. Signed-off-by: Sathish Narasimman <sathish.narasimman@xxxxxxxxx> --- net/bluetooth/hci_event.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 9d8d2d9e5d1f..bd40d8cedc27 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -5314,8 +5314,10 @@ static void le_conn_update_addr(struct hci_conn *conn, bdaddr_t *bdaddr, conn->init_addr_type = ADDR_LE_DEV_RANDOM; bacpy(&conn->init_addr, local_rpa); } else if (hci_dev_test_flag(conn->hdev, HCI_PRIVACY)) { - conn->init_addr_type = ADDR_LE_DEV_RANDOM; - bacpy(&conn->init_addr, &conn->hdev->rpa); + if (!use_ll_privacy(conn->hdev)) { + conn->init_addr_type = ADDR_LE_DEV_RANDOM; + bacpy(&conn->init_addr, &conn->hdev->rpa); + } } else { hci_copy_identity_address(conn->hdev, &conn->init_addr, &conn->init_addr_type); -- 2.17.1