Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp268791pxx; Thu, 29 Oct 2020 02:03:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAwDOE0wBy7DWRKHdY6YgnsDYB5xmyNlTXLJJT9WIlKKvcU9J8BhvWJmJRNRji4k1cNLeh X-Received: by 2002:a17:906:278b:: with SMTP id j11mr1690686ejc.197.1603962222220; Thu, 29 Oct 2020 02:03:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603962222; cv=none; d=google.com; s=arc-20160816; b=ZpfH7ITDariNwJV7awTmPxkDmjprT6Hue7ZOBPsQeSsw6vB8MZxTqDuJzT31+A8eK7 0KAofNS1BJNvTMIznkhFrFIuzQXRfSaIgdJEeM8VXN3dWoqyyvV7Oioe4cToI/fTQWuk l/znGR9mcr6xUwNKTAH3Mq/KFjkZ+j5uEMOekhYhjbFz8jychAmdbYEqP/K0rMjB2Ims fgZPZnLG/TlshACo4LkPEY9K2MD2cvOJk7MbGJQJNZtEtth+2c1AYbPvdNEYyoaYb4Z5 tdwZkKyDQPlqSWZioWoCVPVDuj+QpH+ei3auBrU8TQG1PMKYx/E1hVZSggUgkqkkEZ1G 4GJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=Ai82IumdM6vSuy+0h7CKxIsXNbX0OvBZ2DK13resGTY=; b=K+JjwmQFVnl6l7STAn5JSZxgCP9+LjkoCVDoARe+1J5HnH/674nHNacKC/lmE9GIUZ VHgc47jdHtwHV7bAZrzZtuwIIOOryoiDDGWLY9Uzc0q/j1xyZg6O33xvsBzaG5Ii+kOI uibK/lsENKtZ7ZK8AGZsCNwtBlgaaP7mueDp9ZMToLm5+zaOkR9E1R1VXFNmZqENmjH6 mgWbjkv0OUL4aYAsp6QmCXTPc+2vi9E06jH1W23rSQhgovsf6rosE53J0B1/lTDuALoD uQokEG4LQonZqJZX03TbLt1ga2Da+fu+VDJw5ryMtXQ66l9abkGzgq5myuES4/ZDpZhJ lIhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Rwbh0bwS; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x19si1401210edi.214.2020.10.29.02.03.17; Thu, 29 Oct 2020 02:03:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Rwbh0bwS; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727605AbgJ2HnZ (ORCPT + 99 others); Thu, 29 Oct 2020 03:43:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727316AbgJ2HnG (ORCPT ); Thu, 29 Oct 2020 03:43:06 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B552C0613CF for ; Thu, 29 Oct 2020 00:43:05 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id f21so900668plr.5 for ; Thu, 29 Oct 2020 00:43:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Ai82IumdM6vSuy+0h7CKxIsXNbX0OvBZ2DK13resGTY=; b=Rwbh0bwSAjeIvy2uZ5kttEgHA5Pi5jyepchcqNjREjjj8zKrFwnI50cr7x39V7NP5d nC3SQeOEiaf+NObwMC/cGL3kTMo3MuIBvQmrqGd6mFx9oiM9RR1HSnGIdH5Sr//MCS+j +mpPWq6jaiHKs5Q/4pldVOdQiHAkvge0TLleeH0jIYYg6YCy2UF5TxaEd1i8Rpx5xPlZ xO2NDD2Y+X+6Wvaqm8znHrskeWZSCWZc97UakOs/Ipl9Z6COL7TQ7VLczDouJoAjdLAA Wk6ogWNSgKhTDbiH9wMjd9/Mp+8nag6yOP6RX4hoiNhRl4S6naoZOYJBBmVk4LBb1w4s wLJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Ai82IumdM6vSuy+0h7CKxIsXNbX0OvBZ2DK13resGTY=; b=idv7ZmPxYZU1Bh6NUIZ+jAUznF8zf7ui8iOKkK/jnCphxUXu5pXI4r4qtCXpkIJFxt EzYjDdqX74dBCSxj/QvTXKsjM3X7zpYu0zHbuoX+HdRDgS/z216wPqefebD71OwDf6hH /Matu70MiqbMwZI10zB3IgfKtOiGOBccCF8s7s/DemQUzfa7tQC6UVXKsjZoExav4+6N GZIJX2M/ZIYREbiikj6gKzqASIjLvRDWKy3LUoOyhwaXCE6UvnePiG7hCLgVF3L9njGx ol/pQ4jfT/+YaR0gkP0t9BZRh5D0GiooLHAO46FuYy8ZqI/uCUbFmMjItcyazuZHf6ei nOzw== X-Gm-Message-State: AOAM531tL2GkYf6WmoQMPsKnnbCtdnnLA32nrVg5M/D5bjC6ef5VPCwe LFlqT5CYSznpH+aNEKRh7wdwxzRMBEwUOXuv X-Received: by 2002:a17:902:704b:b029:d3:eca2:d221 with SMTP id h11-20020a170902704bb02900d3eca2d221mr2918412plt.74.1603957384909; Thu, 29 Oct 2020 00:43:04 -0700 (PDT) Received: from nsathish-Latitude-7480.iind.intel.com ([192.55.55.43]) by smtp.gmail.com with ESMTPSA id x29sm1846565pfp.152.2020.10.29.00.43.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2020 00:43:04 -0700 (PDT) From: Sathish Narasimman X-Google-Original-From: Sathish Narasimman To: linux-bluetooth@vger.kernel.org Cc: chethan.tumkur.narayan@intel.com, ravishankar.srivatsa@intel.com, kiran.k@intel.com, Sathish Narasimman Subject: [PATCH] Bluetooth: Fix: LL PRivacy BLE device fails to connect Date: Thu, 29 Oct 2020 13:18:21 +0530 Message-Id: <20201029074821.29950-1-sathish.narasimman@intel.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org When adding device to white list the device is added to resolving list also. It has to be added only when HCI_ENABLE_LL_PRIVACY flag is set. HCI_ENABLE_LL_PRIVACY flag has to be tested before adding/deleting devices to resolving list. use_ll_privacy macro is used only to check if controller supports LL_Privacy. https://bugzilla.kernel.org/show_bug.cgi?id=209745 Fixes: 0eee35bdfa3b ("Bluetooth: Update resolving list when updating whitelist") Signed-off-by: Sathish Narasimman --- net/bluetooth/hci_request.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c index 6f12bab4d2fa..610ed0817bd7 100644 --- a/net/bluetooth/hci_request.c +++ b/net/bluetooth/hci_request.c @@ -698,7 +698,8 @@ static void del_from_white_list(struct hci_request *req, bdaddr_t *bdaddr, cp.bdaddr_type); hci_req_add(req, HCI_OP_LE_DEL_FROM_WHITE_LIST, sizeof(cp), &cp); - if (use_ll_privacy(req->hdev)) { + if (use_ll_privacy(req->hdev) && + hci_dev_test_flag(req->hdev, HCI_ENABLE_LL_PRIVACY)) { struct smp_irk *irk; irk = hci_find_irk_by_addr(req->hdev, bdaddr, bdaddr_type); @@ -732,7 +733,8 @@ static int add_to_white_list(struct hci_request *req, return -1; /* White list can not be used with RPAs */ - if (!allow_rpa && !use_ll_privacy(hdev) && + if (!allow_rpa && + !hci_dev_test_flag(hdev, HCI_ENABLE_LL_PRIVACY) && hci_find_irk_by_addr(hdev, ¶ms->addr, params->addr_type)) { return -1; } @@ -750,7 +752,8 @@ static int add_to_white_list(struct hci_request *req, cp.bdaddr_type); hci_req_add(req, HCI_OP_LE_ADD_TO_WHITE_LIST, sizeof(cp), &cp); - if (use_ll_privacy(hdev)) { + if (use_ll_privacy(hdev) && + hci_dev_test_flag(hdev, HCI_ENABLE_LL_PRIVACY)) { struct smp_irk *irk; irk = hci_find_irk_by_addr(hdev, ¶ms->addr, @@ -812,7 +815,8 @@ static u8 update_white_list(struct hci_request *req) } /* White list can not be used with RPAs */ - if (!allow_rpa && !use_ll_privacy(hdev) && + if (!allow_rpa && + !hci_dev_test_flag(hdev, HCI_ENABLE_LL_PRIVACY) && hci_find_irk_by_addr(hdev, &b->bdaddr, b->bdaddr_type)) { return 0x00; } -- 2.17.1