Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp472725ybt; Wed, 1 Jul 2020 03:01:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7gukm+pJn42Opwm5/rZvBZ/HN6NjQ/T23okj+StgGDtj28TuJgcitcSgxkHNLgrcTNhO5 X-Received: by 2002:a17:906:23e9:: with SMTP id j9mr10932224ejg.107.1593597701998; Wed, 01 Jul 2020 03:01:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593597701; cv=none; d=google.com; s=arc-20160816; b=Jr+8Q/0PyPXi7fiwwTS/uUz3PDKF8otmyHARvCUSYA8OFOFmDg0zMJo6X8CilbKkTD y/NT0qJBlwGr6hqE/Vhw9zvSZp2uQIefFIxd0oZmnKcxQ3+buHRrAo2YT3C16J+PRtDO yanNE0PtADAh7ykdC17K85993+CulHM2GFQhviwaQEGnVWq3C208eA9VBnLE9FaN8GL2 SNfSfXFmVj0J0xYO8gizj3EK2IMR07RWQdXiTP62ybseg8IkCNr+w6IJpehfTGqipKe2 U7pHjblmVlok0p1ujgLl36PsqmL8tYL9hr6o+96jN1Fng+TRovK1VWEvuQQmEtKJiQbB hH+w== 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=XQsMIxXrDju3xAGiOt+lQ1c1a9XOuAjcFVyUXi9Jbzc=; b=gkp7UZFqJC1hwEQ8gJZYCXCm73mpkmbDHO50+0aSBwrZUjqb5k23g/KzmGnroz0HX4 n65ZJSLCdB1NB2IEDwIPFcmbKTuL6Q78/2hfdKNYQ6SVo7CduYiwpcYdm72JBJMcY+U9 BcY8dctjJZ1OTefJz2uPJdkDotBgNKw+4Ht363z54v3ExiPI3mWG9OTpbVBHn/YtPCNy C8A7u53bwmAIFpjCmedlMfQ/sF8KKAijFo98FakkocRJLysa67ACPrz0XDB6Pz/2OaQL ziG9NzJJ+jBEmnILzAiuLIZ2J2PkUv0CLSM/o7PpsdY7aC0sQL/30fROVGy/3x/cs7+L ezvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qPIyk2MQ; 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 p2si3462383edr.239.2020.07.01.03.01.09; Wed, 01 Jul 2020 03:01:41 -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=qPIyk2MQ; 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 S1729402AbgGAKBF (ORCPT + 99 others); Wed, 1 Jul 2020 06:01:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725440AbgGAKBF (ORCPT ); Wed, 1 Jul 2020 06:01:05 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E820C061755 for ; Wed, 1 Jul 2020 03:01:05 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id k71so7264505pje.0 for ; Wed, 01 Jul 2020 03:01: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:in-reply-to:references; bh=XQsMIxXrDju3xAGiOt+lQ1c1a9XOuAjcFVyUXi9Jbzc=; b=qPIyk2MQ7xE5iit4ig06C+IlJAqBoFofUEB3fixTef2LJinF5BBVdOSZ32dvyDYGjA /cLvq91XC6c+wLfj+9998vpSRxamJ8YiDXeL8eVjTjhrlnVPcGDIs4zJ48oAWseaY1iG 6ANcNHxfgxoNW8oZe3Zozw821niCI/k/8b9TeGcj4FtzVneby7XuBiVfQk0eVSc5jZDB gjZ8KTzKxUFngKo7JmLtSutFfYT8gT4WgOKj7+qS51SGebMHSkhM7kiw1cmC+CHWRUfr +icEev1RiKhQwGqY4H1259hOL+lNaEluPwh8W64WGOWgV4b7c3vkuHhLG24R0zhvS9V1 ivSg== 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=XQsMIxXrDju3xAGiOt+lQ1c1a9XOuAjcFVyUXi9Jbzc=; b=o2+uMZYzSfzz/vIa80pbySq2BVtM+2elkVo88N/LoCeFIkiCM2FUQg+yGeLxPCOLId ycS4JaOVxJMURTBIlVx9cN8mQeh5JcpVAb7dOTgIYcsNS+d0ODbIRg3fNWz5M2pAE0IW UGnP5ABfnH2OVGMxiLBsXhoOl95KskyPkRh5nfqKNFdh+rML0103mXqLF9iy7vKEcYV4 oOyjKmYFQ/0esbRe/c12GhtQP1Aza9e1YHcTETUzKg5QbRuGWH2Am/ovWYqxVgVPwwxv ECE+1EwVLrVSBKy1d8lAzNaGKwjsinzJMPbWc9eUVrvWt4WksFy6BNKMtMI7xZodRlSK qD6w== X-Gm-Message-State: AOAM5316USq6PZocLzHVdwfeLHMTLvjAsKYEWl0Q+VBNqMltw/zAgtza /cvDSvfeXo7TYvnFw10yuXGyHXAooP6Cmw== X-Received: by 2002:a17:902:9309:: with SMTP id bc9mr22102673plb.232.1593597664642; Wed, 01 Jul 2020 03:01:04 -0700 (PDT) Received: from nsathish-Latitude-7480.iind.intel.com ([192.55.55.43]) by smtp.gmail.com with ESMTPSA id d37sm5381961pgd.18.2020.07.01.03.01.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jul 2020 03:01:04 -0700 (PDT) From: Sathish Narasimman X-Google-Original-From: Sathish Narasimman To: linux-bluetooth@vger.kernel.org Cc: Marcel Holtmann , Sathish Narsimman Subject: [PATCH v3 1/8] Bluetooth: Translate additional address type correctly Date: Wed, 1 Jul 2020 15:34:25 +0530 Message-Id: <20200701100432.28038-2-sathish.narasimman@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200701100432.28038-1-sathish.narasimman@intel.com> References: <20200701100432.28038-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 1f18f71363e9..abab8b5981a7 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 5577cf9e2c7c..604a411a9b8f 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -3292,6 +3292,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