Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp5431832pxu; Thu, 22 Oct 2020 02:02:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3ZJpLmH2WSEZX/qxjkAFF6RhrmCF/YTPtFLsPqTFq+JUPh7S8TECUXPtXDbf2bs0PHutE X-Received: by 2002:a17:906:b055:: with SMTP id bj21mr836014ejb.334.1603357332288; Thu, 22 Oct 2020 02:02:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603357332; cv=none; d=google.com; s=arc-20160816; b=WVHydADbXux0JmT2GbOgy6Ph0Eelcrde+2um4qrh+cpa/fquG+MJ17cXM+S7PkecOa GyIhFkipaZQv5Fj44yu8nyAuFVPqYVoAxNXG9rAcSjyWVj0sN7u/VdwWPk7Jtdj8KDGA CFjRNqvQUsWfIZ0bKWANvM3Ih/mNYwhpujXtBRNShjzOZop8IcZNCUL745TvMXZRth2q p9tKN98h+eNqL6MxQ/V1B3sD/79Omp3PyWbswVW5iof9d+gOF7H3DvnZTnaLAku/azDb LgXBgNfSS1e7eVMTypFL/MvxhUrtLf+rty827dYG5Z3qk6q+qYELEAiUTexPtWeI1y8p O2WQ== 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=UZlh+fxUzLJ1uC8gQyD6EpRae37oweBPUkkyoUkVHCc=; b=T44OxLn1JLvKS9FyffKJF7jUbMcI3oO8YltrRgLLVldZcyIXKjlVa1Mf80Qm1UxCLC yobqowmVVoh8CfMtItijXRW4OB33BLkGSxhd1/Mq07G/CgQ80dfcXwgv4lNRtrjcTg6d Ke6ENH7Tw4c4P8ivSry29To1aLfvZjtapdvr85eWJtCwJxoPXROpvPohXmjFUF/Rtqhv LeTuYEzUSExFvORMfAazWVE1Oo+gcO4Tv+9J84NwPtatmJp3/wsptDY7QBfnmQMx19/A jMKM8pKNmGPkpCLelF/3lsHL6212wjESWUCojoMbL3hlzliEgwe+z/89KcldsmZox7He FepA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ecEk3Tc4; 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 q21si573943edb.117.2020.10.22.02.01.37; Thu, 22 Oct 2020 02:02:12 -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=ecEk3Tc4; 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 S2894771AbgJVIRd (ORCPT + 99 others); Thu, 22 Oct 2020 04:17:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2443831AbgJVIRd (ORCPT ); Thu, 22 Oct 2020 04:17:33 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A61FC0613CE for ; Thu, 22 Oct 2020 01:17:33 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id o3so482271pgr.11 for ; Thu, 22 Oct 2020 01:17:33 -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=UZlh+fxUzLJ1uC8gQyD6EpRae37oweBPUkkyoUkVHCc=; b=ecEk3Tc4XWs5RquLUKkANziqC7VUDXd1li/jCNK9fo5EdLHHBiDDuMiyGuyCunL83e R/eRK6RHiIfuDkllbuyUatRHMFuwUpErwt6tF30ehYBm/W6M8OBevI1wpetGMbBFIRUT +2HT4otu3G89KANrU1hJX/6MyFCo3woyqAn8JoIrrIhrN3blq04llqPf7WcPnPXD4gv+ iZtiMZPh0xOBHTzTCRr4dvqYbM7z3h3o4Un2k04k33hylkZK1lJswuI0KUKk6a5ekZMj KM0iAONMZYRMFj8rTfAlJ1BIFCC+VSy8MmluwJkeJBRSCwbNVcWqcZl6j4R2+ky5N56I 7uLQ== 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=UZlh+fxUzLJ1uC8gQyD6EpRae37oweBPUkkyoUkVHCc=; b=HAEFI2iTuI6yeohXARHxVpVPiUDZSs6NwIyGMW/M6e+UyW4Y24VVXNynVKAvGLYktn sI7x//fWUxvtn9DmiHVMxN3DEUyy249+EuR8anHn8y7oOcd4zNHMgfjYWxDAjADbQnal 4Y9EB3FlHBsr6ulxP6oIL+U1cgGlw2ZnUf225EXY0hZSzoFGmRwwIJrbK2cgBbgrsBno tE1O4+9zUFYHHb3a1of/wlOjG70aGptiGhMXZpUuF3jES5Vya4M+GMWSp2mO4lvrh3ux Y68gYnGJq2ffn1sY7aOpliPsz4LB1F07V6vAd5AqgAghc7AXtD2SKlzP9CndmHaW1dDP V0Lg== X-Gm-Message-State: AOAM530kOUEFhhKTpmwegnU218aTa/2ZaXV+wqnevfNBpR8vIR4kOC94 4qdhVkvvc2OPrRJ1wlk4n1iTp4pm+D5eCw== X-Received: by 2002:a62:ee10:0:b029:142:2501:3972 with SMTP id e16-20020a62ee100000b029014225013972mr1313414pfi.55.1603354652521; Thu, 22 Oct 2020 01:17:32 -0700 (PDT) Received: from nsathish-Latitude-7480.iind.intel.com ([192.55.54.42]) by smtp.gmail.com with ESMTPSA id n18sm1188235pff.129.2020.10.22.01.17.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 01:17:31 -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, 22 Oct 2020 13:53:04 +0530 Message-Id: <20201022082304.31757-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 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