Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1298257ybh; Thu, 23 Jul 2020 05:36:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzw7FODewpJZGOVacw/cChSDNukuBUadmWH8zPJnMS+KSi4gwAV/QXaoODmRDn5KBgogLbM X-Received: by 2002:a50:bf09:: with SMTP id f9mr3871200edk.249.1595507765373; Thu, 23 Jul 2020 05:36:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595507765; cv=none; d=google.com; s=arc-20160816; b=CJuqy3j9j9QV6germd5i143w4DjyQZkRCqFUjsLavMJYAz0MP0R6mUn9YcU0JinELq Oz3lZOUDVedaUwrL/gA3GDZg6Qba/Lw5Yc1S0UgDRMnNiJ8PCSirdwdHlDhhmx/FhaRE d+SIaOFnDV3ovSZ6V6SC1S6TC0/+T8EKqDKVr1BnB5WX0QeX7cMoLEaMi0FlbLVNRNbf zZggnm/je7hyfToo4RRd9UGJUPjxtRBDz2ou70gLYMKjhQ2IUEmnYXFTn2e8Yz9pqFbN sNbwdTok7DmrexDM8cmX2wtD/nAyLWNp4ZJ9JnfmX2wEaKJYpTyd4RBFT2EATkS50HQ/ IUNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=xSub10RztAkAVkR7dQ1tuib+ohmh4r9LyvxXZPcSzms=; b=dqMYjF7OyWxkRoRZnhrzbyZRKLRMDxCH4zOC6fnNKyTOfScoCKu5meC7WnwGrXwJBp 090IlI2GVOzC3HzBtr/ItXbg0YeD+W7JKsCj28qb0ucSl3epAI1HesUfZ4kJjf1q64Ad SJISIBRtYW3UqgmORcJs1ZliguhtYCp2VkP0tEku3snYrO9Q7YrNnN9a+JC7O4OFl2N0 1sZ/fl5mEcettMGF8eg7WXgcr4hCm+WPMP35EN9NU0iaXIMn0+8FJCVBXf15TwlrwCCU xx27wB//zv626nNKaUYuBG1a98J/GOFXRUegEQ4qfCWM0PKhBYpQljjd6DMMyjzrYsyJ 9GvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=t54Jm1mi; 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 g18si1875645ejp.681.2020.07.23.05.35.30; Thu, 23 Jul 2020 05:36:05 -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=t54Jm1mi; 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 S1728709AbgGWMfL (ORCPT + 99 others); Thu, 23 Jul 2020 08:35:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726109AbgGWMfK (ORCPT ); Thu, 23 Jul 2020 08:35:10 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A881AC0619DC for ; Thu, 23 Jul 2020 05:35:10 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id 1so2940276pfn.9 for ; Thu, 23 Jul 2020 05:35:10 -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=xSub10RztAkAVkR7dQ1tuib+ohmh4r9LyvxXZPcSzms=; b=t54Jm1miiYNTB34tY64pYv+E9aKT8h/8GNbf10lz/YcAJZPt/KM7p7Z5oktdRwSDug fo6RPfuSHjheWzwfNEjlR72nyFjwIwfSTu5LAVGepzfIqHxMmLPoUxxQdmkO6n5+j4eq K/0wuKl7c0ewyMAcAaBP27nJ7p9U5REeYYTJD6Q2n9oaP6Icj3Kw8JRDu4sHWyy5sJOH j6z12sx0loPkTNuHRskcsqhBFxzNyGyGMe1lww7S1QdX32lnSPxN3WeOGqDFYJrsJXd9 BxB2YUCDpr3wx9ByG0RdWU4ndmCUIbi4THWd+2NhCoSFaJChtUgi0EUWv0SpDBvOivtL Hfkg== 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=xSub10RztAkAVkR7dQ1tuib+ohmh4r9LyvxXZPcSzms=; b=X+Wh/0jVu/ICm2CpB9KHLK75kaRMGT7E6XzzF8qwatNZmdDl/NH878K26Y3sZ1D0dn 2RNLM1IuKIMsxImBDVFa1zUfYy+guvzWlOUe6/+kwP5LwyKJ/DDnR6J84xUdk2xKi3jt NDu9N1GJv3VVtZNh/nG+u+ieVx7LBUQLNS2Xi5GV7TE46oYQmO5e7oNelUKaqrqgMhFh shkkjdg/z2/emu4liTiCHfLp0U2FdrEtHuxQ5xEYUXgx2sc/yYAwTb6ct3p69Uv4lM7v 2q+tecflb4pr+EStLPdt0SEGpEzgg98ZxXfghgCFkLBaH30cbjueUAqDEKtDm0HaMKg7 PypA== X-Gm-Message-State: AOAM533SVCGD18Mox+qhylwaxpt/QJtHY/iHR6dtFbR4W3qZwVx5iBhw zuo5avbmtUtnZGxh+fyu742bWXJwWhY= X-Received: by 2002:a65:5502:: with SMTP id f2mr3857382pgr.375.1595507709769; Thu, 23 Jul 2020 05:35:09 -0700 (PDT) Received: from nsathish-Latitude-7480.iind.intel.com ([192.55.54.42]) by smtp.gmail.com with ESMTPSA id z11sm2849823pfr.71.2020.07.23.05.35.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2020 05:35:09 -0700 (PDT) From: Sathish Narasimman X-Google-Original-From: Sathish Narasimman To: linux-bluetooth@vger.kernel.org Cc: Marcel Holtmann , Sathish Narsimman Subject: [PATCH v5 1/8] Bluetooth: Translate additional address type correctly Date: Thu, 23 Jul 2020 18:08:56 +0530 Message-Id: <20200723123903.29337-1-sathish.narasimman@intel.com> X-Mailer: git-send-email 2.17.1 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 6509f785dd14..4af208b82138 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -3290,6 +3290,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