Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp662201ybg; Wed, 3 Jun 2020 10:15:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMJBF82YDRCuQAsxXj9I1dpkoLhDNZfda2HeeiXx8Opu4lSC4YS/9R4J4pwbDvJMO4NGQm X-Received: by 2002:a17:907:9484:: with SMTP id dm4mr345418ejc.56.1591204501992; Wed, 03 Jun 2020 10:15:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591204501; cv=none; d=google.com; s=arc-20160816; b=ENcO9Ob0aJXk4fGnPBdUdsHRYjZuq+wpuTA3v2x2XyDijCtl0FBEuRqoURkOeNFkoB 37dCUrDxas0M24zFkZJP+aO/KYlvKUchloeEOdnBMhBinID3KkTWYtBbM7XyjC3NecTl PDo7x8ykt5rZql4f8GWDQB+zaXo5N0fSWLaLimbUjziUxcYFB9xi12jc1AwBkZdSQVmF 97IknW2MRHsFfqV79PsGbCDLbtOL411UvX0/c2D510Bx/ak61N0Txqjbd0w+pLyDu3/9 mJ6i2dQFJqIrZs/J/LI7n2hOHinN0gFaBBorPsXXMMdJYCRR1XOulcJj7uvjLjtOY7gb O4Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=CuTW1YSo6SbIPQ+NugG8xNnabM9kKD5flh82Xdj9G2g=; b=iWNOBigRc1HBM9AGlGnKcRl7SxjwNI3h2TC01lx0JEaNKhZBECkKqr5lDPwU1qLb09 3L/Mwu60QOk818iujRuDctToFQLhmenqeKfoJBIny1F4tY8n3UTGPSl1BFEfERJKmAro xAICbds4ItZybT+Vy2dgX7aGw32JgkehmtONobo4BLdAuJ6zy3rswPpa9EH50A6VdtiO /rz71Vki5yO+hZbqc//aYvUJscYO2ioUb1Cr4VKEUb8y/walAbSToj6i0AL+ATRCFtLL xKOp/WGoQ6hw0MI+3PcmH/d1YAzmz4YakpAANuIbCW4OodOhfvlFePiETn20nAS/Pw7D 3XSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AqIZdmER; 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 d18si92533edr.366.2020.06.03.10.14.19; Wed, 03 Jun 2020 10:15:01 -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=AqIZdmER; 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 S1726134AbgFCRON (ORCPT + 99 others); Wed, 3 Jun 2020 13:14:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726046AbgFCRON (ORCPT ); Wed, 3 Jun 2020 13:14:13 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B8B0C08C5C0 for ; Wed, 3 Jun 2020 10:14:13 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id s10so2220814pgm.0 for ; Wed, 03 Jun 2020 10:14:13 -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:in-reply-to:references; bh=CuTW1YSo6SbIPQ+NugG8xNnabM9kKD5flh82Xdj9G2g=; b=AqIZdmERFi5Y3RTNmnlfaTFzw+mHC3sV9IZZQmeVtkfc7JAOWEyqTcnvfqTZskloHH ZFQ2B9p9hBZMQpah5RhFoOhMVv5JuWjsM//UUoYfEpW6SrOfMZgddyAtauSctTiAxK9W y5zT3y7hi97tMiS04YCJNXhAREml1hsWx0euIi7jAG2HWO33i30d/Ouy1TtSctrHHjkn ZwasvGy8ubqD+KFNusBjQPdTQxjBidoQWJzHL57ZuJmY1N6jdVW9YjGpy1jbtk8EsrjS RH3L47w9b56NjOlTY5bTUioQfBETcFjX6GFHlwlio1215m+Y2KJ1JL4dzc4TTvVvmclC 2gmQ== 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:in-reply-to :references; bh=CuTW1YSo6SbIPQ+NugG8xNnabM9kKD5flh82Xdj9G2g=; b=eRAdYvJEbcixQGIgxHP40UvBd9JFxAeAUQBJRVaSC2pHGtzdpiZZWNiZV7+j1hSiCx dncgqmVdNxPoR8mR4/YdU6MIJbLwmly9t00urWZ8q2a88U9t7PhYn66PbGB+J72pMA52 3eE893cVBWGuyeoQaKNWGNWBgkiNwMd74ga/e7dVUTXf0kl8eh55eCqKCXlc5h5Q/bJ9 L8YDBAtz/boPLHGtNPGcsRFHFpoAHdQnXbzGv7uwCMFpCwQvY1YEPoy3Y2xMia08iQMM nWLIYgPbKqOL9frxyFparxExg+MW0nNWLA+++4SAjzL6h6cfFbJ2qhjf/qqlw7CE086+ HPtg== X-Gm-Message-State: AOAM533Oz7W8zOX8lIDXgmU9ssLAPkmQODwZEFN69y/4x7acVdcXt6Wj OZvzE7BqF/iEFlZlEIKbJy3b0RsbzoQ= X-Received: by 2002:a17:90b:252:: with SMTP id fz18mr866840pjb.96.1591204452769; Wed, 03 Jun 2020 10:14:12 -0700 (PDT) Received: from nsathish-Latitude-7480.iind.intel.com ([192.55.55.45]) by smtp.gmail.com with ESMTPSA id x190sm2016770pgb.79.2020.06.03.10.14.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2020 10:14:12 -0700 (PDT) From: Sathish Narasimman X-Google-Original-From: Sathish Narasimman To: linux-bluetooth@vger.kernel.org Cc: Marcel Holtmann , Sathish Narsimman Subject: [PATCH v2 1/7] Bluetooth: Translate additional address type correctly Date: Wed, 3 Jun 2020 22:47:07 +0530 Message-Id: <20200603171713.9882-2-sathish.narasimman@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200603171713.9882-1-sathish.narasimman@intel.com> References: <20200603171713.9882-1-sathish.narasimman@intel.com> Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Marcel Holtmann When using controller based address resolution, then the new address types 0x02 and 0x03 are used. These types need to be converted back into either public address or random address types. Signed-off-by: Marcel Holtmann Signed-off-by: Sathish Narsimman --- include/net/bluetooth/hci.h | 6 ++++-- net/bluetooth/hci_core.c | 9 +++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 16ab6ce87883..1165dfea56a9 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h @@ -2268,8 +2268,10 @@ struct hci_ev_le_conn_complete { #define LE_EXT_ADV_SCAN_RSP 0x0008 #define LE_EXT_ADV_LEGACY_PDU 0x0010 -#define ADDR_LE_DEV_PUBLIC 0x00 -#define ADDR_LE_DEV_RANDOM 0x01 +#define ADDR_LE_DEV_PUBLIC 0x00 +#define ADDR_LE_DEV_RANDOM 0x01 +#define ADDR_LE_DEV_PUBLIC_RESOLVED 0x02 +#define ADDR_LE_DEV_RANDOM_RESOLVED 0x03 #define HCI_EV_LE_ADVERTISING_REPORT 0x02 struct hci_ev_le_advertising_info { diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index dbe2d79f233f..f4ceda1f1454 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -3145,6 +3145,15 @@ struct hci_conn_params *hci_pend_le_action_lookup(struct list_head *list, { struct hci_conn_params *param; + switch (addr_type) { + case ADDR_LE_DEV_PUBLIC_RESOLVED: + addr_type = ADDR_LE_DEV_PUBLIC; + break; + case ADDR_LE_DEV_RANDOM_RESOLVED: + addr_type = ADDR_LE_DEV_RANDOM; + break; + } + list_for_each_entry(param, list, action) { if (bacmp(¶m->addr, addr) == 0 && param->addr_type == addr_type) -- 2.17.1