Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp245783pxx; Thu, 29 Oct 2020 01:18:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRI2qWOzQv53XJVzeOY+/H4Fow3D5XU/J8ZzE/rFjxh2OJ6dzfAMf3a8vIq+HwyU5kL/CP X-Received: by 2002:a17:906:4a8d:: with SMTP id x13mr2989558eju.47.1603959496719; Thu, 29 Oct 2020 01:18:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603959496; cv=none; d=google.com; s=arc-20160816; b=e7JAjz/CXZfmtMqzSu/HRu/r/l4LGjsLwAoqWaJmb2Ua3C6bwRLJicYv8ElRwUvJWB yNQieH/HB+uSju7KQZJRfjdkLX1n2wbIB9ceIurC9A3RFqy5RBhKNS+/uEV/jy7oupKP MMLHkBgLvuLHLiOJ8No/YClnD48gFU3fkhx28Ukd7eJkQ3kA95QIUAkEKAmyCr3+RVU0 u6Fo0Qeno0voiv1Xnn9U6Bw0ICdaan30zCZzBs5LXfNqNkD0T8x+KjbihVVLZSB6euBt bv/VdYSD/MiIdcZoq7Y1Lc5Not+JNBmHoWKK39qZQiVo4RPphwTeRrV6HYHi11P7BWom SpFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=FTdRXkU1iOmXfsen+GUO474+B7vMyiAcNtBhZvZXNeY=; b=AwZ69S9HvJETJH0LLqAxY4NujDY76UX/B+OfUlfgeRJpBTa5QkRoKDLY0kwL+Afzor EYcmCDK4LfzDAFXL9pgw3UGRhTVLFe2MfxhE9uQSJkgWXdDXPSJp/mTVYjrnfL+hDqOm tJQICEcHttXNhl7MMGSfoezZtgiFxubS8dE6muxvt2PZKvm62NVvFogM3P6Gd0b8/lP6 lql/qS8QHAm0T37mevLir+vfrotZxP2lq7NWPjl4DhqB0kSqjZ43ty9GAf8KMV/Ms7vM fK3IeLslSeQvCY9Ek6sq3fz6lIj/NZrtA0hIpwcmrQPgEtvihDtZ5Tb7wQBhhutiaEQs X5xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=C+pUw3gs; 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 i3si1348608ejg.325.2020.10.29.01.17.41; Thu, 29 Oct 2020 01:18:16 -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=C+pUw3gs; 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 S1726175AbgJ2AVN (ORCPT + 99 others); Wed, 28 Oct 2020 20:21:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390904AbgJ2AVJ (ORCPT ); Wed, 28 Oct 2020 20:21:09 -0400 Received: from mail-ot1-x342.google.com (mail-ot1-x342.google.com [IPv6:2607:f8b0:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96FA0C0613CF for ; Wed, 28 Oct 2020 17:21:09 -0700 (PDT) Received: by mail-ot1-x342.google.com with SMTP id b2so849287ots.5 for ; Wed, 28 Oct 2020 17:21:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FTdRXkU1iOmXfsen+GUO474+B7vMyiAcNtBhZvZXNeY=; b=C+pUw3gsPkjm66Cc7MTOxVoH54wFIaZflNx05BqZ+CXSKCznZMOwb670d8vAq5mM/j Ipe23ttHepklJmbL3+GFWYIPjOTFHmlHDU1J9sc9U2eAxImThwipaqS/h29HFG6Y/4cr 8Aw2WeDssVeT7ZmKzyf7RvF/2HsKvUxwXzxIEh8GM6AIsR5xWQhbvrcN63BiQUSP00JF 5s+VD4dHs+nblui9ERGKq2CgBvNVKiVuu8QK6dVZ8QDI+xQSRFGpBhmDtF7tNDKLSrcU LslyxdIEYY5CbnJf2WB59qFi+dyO0/dBwP2ePAnLdL7JnwX9bCgL1erqwKPsFx5S4gAY kmiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FTdRXkU1iOmXfsen+GUO474+B7vMyiAcNtBhZvZXNeY=; b=I+Rxf6uOZOwzdI36wedKOCR5wkjpk1wHEBEqoWYHy+wVBAFPuBLTSkjT/XSWkRlnjb vB38hvC9xvN5Jj62pPWrJt5h8X9fcp0pWUY7rvKUNQRlGh3gj3JyTD/7DVYcR8mOvJDy ESdop66f3XhP8p0Tht0PaHRKWQr/XsGJggtrAgrLAHw6GRHoTeKWwCESkXiM38v7biE+ clJrit59hfCFWJFsPArxp+vqM1OuuzqcsvjZlPFUjgnliQuHJ8mEIJh/vGrLXpWQfrAS fpGUSye3lgkZv9wd018QWGFonlFIo1ysJbzbC0rZ+4w5PIxLsT8YXHKGmoma7RMNDz4r Eohw== X-Gm-Message-State: AOAM532nK1PB9/7FsapmKn6FAJ538uLi0HEOE4vSBFdcGyrMmvS/Zs/z TkV7EPksyB9ndVsTZuFkrZnXwTlkIpSXuFSpA5A= X-Received: by 2002:a9d:6a0a:: with SMTP id g10mr1396613otn.44.1603930868932; Wed, 28 Oct 2020 17:21:08 -0700 (PDT) MIME-Version: 1.0 References: <20201022082304.31757-1-sathish.narasimman@intel.com> In-Reply-To: <20201022082304.31757-1-sathish.narasimman@intel.com> From: Luiz Augusto von Dentz Date: Wed, 28 Oct 2020 17:20:58 -0700 Message-ID: Subject: Re: [PATCH] Bluetooth: Fix: LL PRivacy BLE device fails to connect To: Sathish Narasimman Cc: "linux-bluetooth@vger.kernel.org" , Chethan T N , ravishankar.srivatsa@intel.com, Kiran K , Sathish Narasimman Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Sathish, On Thu, Oct 22, 2020 at 2:04 AM Sathish Narasimman wrote: > > 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 > Reviewed-by: Luiz Augusto von Dentz -- Luiz Augusto von Dentz