From patchwork Fri Mar 21 19:45:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 875515 Received: from mail-vk1-f171.google.com (mail-vk1-f171.google.com [209.85.221.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F89241C64 for ; Fri, 21 Mar 2025 19:45:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742586353; cv=none; b=e9aOUeZZjsuMAIojHBvnkOzaYTePcV4hiKNlKLn6SDPOQOwo8Xlqr7UnpxoN+Ah45KF5weVzDBXMaOgdmJ7/c/5Q/8SaluJVmUOskviF28k3zvBuzVRhZDlDvP+kOAJfGy4kavVH2wR7vRmZDg7D4zFnoFPpNfl/zCA9xRQiLOo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742586353; c=relaxed/simple; bh=USJvLpemHmBWdpM+Yu/IlUrbuNGcOT0su0cG3RU6qOA=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=aMBCNVIpyaWI63/1D7VitTfNaxWiyi/4GHoDn4chx6mp3wvgqm+Ur2uWeWe4BURv/h3lqFIcRbpHPJZBGujaw1vxySXqah7uFkx1z8Z2IXrpl2xjHnmcuuy8wv9XnPDzegrJ7arAXuuxOD2ZPpr/KbDAxZN7Z24Ldt5ko0hVGHA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KmiuRZNV; arc=none smtp.client-ip=209.85.221.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KmiuRZNV" Received: by mail-vk1-f171.google.com with SMTP id 71dfb90a1353d-523f721bc63so3045013e0c.0 for ; Fri, 21 Mar 2025 12:45:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742586350; x=1743191150; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=sY3VK+k9fQlOzDn+gms0VEXawpB0JCEdap4mn3LAEDA=; b=KmiuRZNVLviC2dVcZEaVJdC+MP9YhDs0FlgYAjO8nZMv6ButEVN7IWr5CEPXR1e0Zw 5uKRZRBy0iWMBpXQWL8iR0OMbEp4ZG1FLouJ66KHyxPCspTjCrGBvzjOz4Oo2J7ogkI1 wsBldJHKEGw2BdURDTCITd90MS/mYtUGSNLXkKItJA6KVJ3W3JZj1H/3covWevAWUOG2 8bdlxOhohafEnqmRGGih/Kz5fo3IXqVfKISrH9P9+KhGGVnfq6i8XuKqc4WHTV6xokFr 1Qn7IkQyZ4tK4j8LC7T7pWh0mhayplFDYRKTZuHVrfNbRKOjmTnpQH8b+A5p73skXj5U wkRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742586350; x=1743191150; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=sY3VK+k9fQlOzDn+gms0VEXawpB0JCEdap4mn3LAEDA=; b=UramebYzPsQGj2IFxbAPDZUcZbYjwREZMy+hLqCWowXZEKFowOS/meggp6D3AkCHVA FFELAkEimr5SA5FcoIop0R2DWfvn2DAhHwSc8wlEm6ULJm0Ao5t0pttOQgJDz0pn9WH4 KSOMRafwj23Ttq5FCmPbwDTvGxqB1rjB/KvgNeoQ+4yqopa9GN2mUkiUPmWzbvg/Q/3D zU2DP4B2NEQyokBWSPilxCrRYW041k8NecM0CC+lPuQEx+fxpS/ztvffaMCqIqs8vC1J ilWBUzzzuKlSBo33nSRgtT1lxGTwE9ysRziMa+1VaNVbuW23T1qE2KpquVqUz/JrF/Fj CVbA== X-Gm-Message-State: AOJu0Yypt24yve2p43Speif9YM12uWgArzmoypq3euq3ZK3/opupus3p r4g7pDJRLDmXHXzSAnbYo0ZsCabk49J/wuLuG0PCz/kn1Ie+YUj8k207tyIY/bo= X-Gm-Gg: ASbGncsFFhryPZPpPOkZWrJRwwuoHO57pKV7bmoL2ku+IBR+BEnqC+fFCGpYdbpK3Fa Iwcuq9ykRKUQqxZC28SMhr9NMA5aeWYJ4ZYjwpPdab0amLJ1knjLuIdYWX8wNqxKdGsM6vK9Un9 Vv+Rcva8joTrEq8NBORi0NlG0d8ugkK7Bs0N97kqKxwBk/n4rltejGEdL1ijknbVbCVKgrYWPph PAC2j1lktpJmuE2r+AkcZygeHzeK8yZNGdoBa6DMBRfSjy+pihgnQHAWCb5gWZC0mufuWUy+cxn sF1o5olptqtDIlH2t4szy85JFg3wlqpFICh2QupkWhkA0oYzvLZgTaWelDMGKSrs7wpWW8UMjjP uVZYGF0TFGIE/jQ== X-Google-Smtp-Source: AGHT+IHVzI/vrpgA/stXghDmcmGvsOgovcyQSu5rWVaEsF79DxQkwQbe+8oo6HWv+Dx9FSS4+CW4rQ== X-Received: by 2002:a05:6122:2395:b0:523:620a:ffd3 with SMTP id 71dfb90a1353d-52595d6a7f9mr7414920e0c.1.1742586349911; Fri, 21 Mar 2025 12:45:49 -0700 (PDT) Received: from lvondent-mobl5.. (syn-050-089-067-214.res.spectrum.com. [50.89.67.214]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-86f9f47a3a1sm519917241.33.2025.03.21.12.45.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Mar 2025 12:45:48 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v1 1/3] mgmt-api: Add missing Device Flag Date: Fri, 21 Mar 2025 15:45:43 -0400 Message-ID: <20250321194545.1728631-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.48.1 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Luiz Augusto von Dentz This adds the missing Device Flag - Address Resolution = bit(2) --- doc/mgmt-api.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/mgmt-api.txt b/doc/mgmt-api.txt index b4a5776574f7..3181607d94fa 100644 --- a/doc/mgmt-api.txt +++ b/doc/mgmt-api.txt @@ -3429,6 +3429,7 @@ Get Device Flags Command 0 Remote Wakeup enabled 1 Device Privacy Mode enabled + 2 Address Resolution enabled This command generates a Command Complete event on success or a Command Status event on failure. From patchwork Fri Mar 21 19:45:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 875313 Received: from mail-ua1-f44.google.com (mail-ua1-f44.google.com [209.85.222.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4F2BE1EA7C1 for ; Fri, 21 Mar 2025 19:45:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742586355; cv=none; b=IH83B+RkpTKs95O3e7QDa8zxWlwD/901IHv9vwU2bYQl6pwEFvaV1F3M7x34sW2NvKLBUUGvG2llgoHA5tEPv917vmdd7BiD9vwhYnEgT5QNJmN4qBYNrIVXNx+9mTBJAgj1pdS6NwWip2MkN/aYEVOUEUxxiIkNQazExN3hX6I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742586355; c=relaxed/simple; bh=BEugHfuWTTWwpom9bxqbBFACjK5cjiXEg+fSDceHnjE=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bNMSkEHO0vkDhi9IMAuTloE0Ox2RTjHr7ArE3GgqrN3l9CJidCO1VzXmBb+/TCPaBHfjQjycikOSuOOOLpM0K1BJTwxUifN2thLhMV4iuV/4b1xYx2H3eMoKIkdMkwaOIOT/BY//wrW7ZAo4H2tAqDRNEsHiWi1vISqyMi8zonI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PoPG/ck8; arc=none smtp.client-ip=209.85.222.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PoPG/ck8" Received: by mail-ua1-f44.google.com with SMTP id a1e0cc1a2514c-86d3907524cso1011339241.0 for ; Fri, 21 Mar 2025 12:45:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742586352; x=1743191152; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=8yUFzEeP23ae02zx94YcHk+D3FSZrRH8pMWsZ4/dLsk=; b=PoPG/ck8V/h8lHSIbeWIDluu48cx3HqGgyHY6ZJq5S+vgtpHYg9Zy/4FzBhEfu3jg5 dlvV9+BtIdjY31/mM9b77wr/UOvjQZwksIfCx5E9yhkGJy8xaBbNZSvZC06DXW8AKv7c 69KY2di8Vc6ubvGpDY96qdiFfSn9/Z/SpDR+flMuFKCtCOsgIljccOulb9Rwaoy5Bl16 SBG3MjzUA0S/5LxVlq1APs5uzHgXDG1DV8Xc/s+nPZVV4EN9pP32/uXYmuQSprxRBUDd 86EG9OjFA4/rj1w1xVIPAUQrVOhgpVbE3Lj3mzXQsswkXPwCPFSdjAbGfc5hWYudFm9T jS/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742586352; x=1743191152; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8yUFzEeP23ae02zx94YcHk+D3FSZrRH8pMWsZ4/dLsk=; b=LcAIrqt9IXPrxr66bM/Od+BJb/pfaaIqtRP+mLlHzGZrKFUHR9a5UY2bUWDpNrGzk3 X+f7evaQOQLQcnTcJ+3x6N0F9TDnEU1Kvf04Wnyj45fAzMAuQZHldi4kAM1QDS2A4go3 fHGFWvrsX90YE4Me0Ch7rqbakRtyaiaJdXLyY98gKJy/qJomaM3DDvhQeiBpbvn5WVU4 F66pMVwrGnIgyg9BHWPBo1TGCA0jgkMh1JBOFpv+0VnYgynoYpG8jpDBpGRj8Nxq7q4j xYHA7ppB8rGVgUBPWUMsIslE1hnFQYecMtFNWJslGrKx8KZ+hBiy6S+AI+7VlLa5yXWl IVHw== X-Gm-Message-State: AOJu0Ywzf4OTYnAyGHmYPVjilZPl3xrQgyRbhOaTkmEHTeSWAeh/pvVE YFlrJgKuJWk3Y664MBxYf8EtglzFcPm2h41bkxX4SYshWejhuc3xp09wPh/Yvhg= X-Gm-Gg: ASbGnctkHlc4IjhMsABW7F6QLaXpquP9GBuI5IQTxXA6YjSV6YVL1yRvT9jVs30fJ8S vZStV1mmfS13hiKLbHG7uXZMBWky8QE61p8I8svUp3RaHR6k12n078xOeCQm3YMqO4yVHC6zqBq JXtecScE+DUy48CtD3e++b31ElfmooFxuJnH7Q+lknLYSOJez75cJThUN46UQ02nI3tFPTWplVU 7tqILFz7uLAVVC8uEKoSmK7pT3v+cpSVy0vVSQww7uSYeYA+ML/sLAtnE2y5ep2enDD4f818f2u RWSYWBLEpKtzNGyKsi5AT9128ImR7Sh75NvfAZA39Lh0awCdZX3raPrN0+175sYWX8WLQSxNqNu DwXG8OGg/fSNwRw== X-Google-Smtp-Source: AGHT+IFE9+ZgxjLBSNnjnMoLQwyXCpRDboqhpeCxVvyJNWdg4Z/FnFdlik1fCC4R626S7Tw61GLrSQ== X-Received: by 2002:a05:6102:945:b0:4c4:e0cc:fb39 with SMTP id ada2fe7eead31-4c50d4fd939mr4703392137.12.1742586352405; Fri, 21 Mar 2025 12:45:52 -0700 (PDT) Received: from lvondent-mobl5.. (syn-050-089-067-214.res.spectrum.com. [50.89.67.214]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-86f9f47a3a1sm519917241.33.2025.03.21.12.45.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Mar 2025 12:45:51 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v1 2/3] mgmt-api: Add LL Privacy setting Date: Fri, 21 Mar 2025 15:45:44 -0400 Message-ID: <20250321194545.1728631-2-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250321194545.1728631-1-luiz.dentz@gmail.com> References: <20250321194545.1728631-1-luiz.dentz@gmail.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Luiz Augusto von Dentz This adds LL Privacy (bit 22) to Read Controller Information so it can be propagated to the likes of bluetoothd. --- doc/mgmt-api.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/mgmt-api.txt b/doc/mgmt-api.txt index 3181607d94fa..2fe8ca22b9b5 100644 --- a/doc/mgmt-api.txt +++ b/doc/mgmt-api.txt @@ -336,6 +336,7 @@ Read Controller Information Command 19 Connected Isochronous Stream - Peripheral 20 Isochronous Broadcaster 21 Synchronized Receiver + 22 LL Privacy This command generates a Command Complete event on success or a Command Status event on failure. From patchwork Fri Mar 21 19:45:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 875514 Received: from mail-vk1-f177.google.com (mail-vk1-f177.google.com [209.85.221.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7EEF91EF08F for ; Fri, 21 Mar 2025 19:45:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742586358; cv=none; b=KA0XLKYUvthNrjkbWIkezLY5VACdLkMDyKH/5wfuXOhti3uq7kqZs4zgUl3BiEdYla+jybKB11n2GF5C3Z07/WfPTwxnwBR9Cxx2P7XRLTonYSkmMZCql3yAn9hXze4BZwqDHZR+rBRGCrXuWCqXoNlKgQKLIfDo2UZYeFOlIic= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742586358; c=relaxed/simple; bh=TsHcO60Doh/F9dJAx/j7knTU2Ga9Ykgsj+vLG8CDmtI=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ktKLGK1MCv8T9bSlSKTjxGHp3ErSlJ0TB1mE5l4JkfeBDpzAKNhnOepIWaHrfyF2LNF/Cy3vw7eWurvqqn2BLzIRtBzwUlbbm/OS6tzAF371dpU1XBwiIVRi1MskjYjNqgrsg/fLAp5PmBV+mcYH+sF2iJZDv1HzGXQyoJ9FcrQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KiUH0srL; arc=none smtp.client-ip=209.85.221.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KiUH0srL" Received: by mail-vk1-f177.google.com with SMTP id 71dfb90a1353d-523ed8ac2a3so1143840e0c.3 for ; Fri, 21 Mar 2025 12:45:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742586355; x=1743191155; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=W//AVeA/S/AgYB5djWx8LPevziOnuNP3pIFHfFSzRYk=; b=KiUH0srL3+xuib4WTdKWOnZjAD0NJqBjkM5Gl1Hy2MNXx8Kt4FHg6hzrlNuUGSm2bo d/pJEtSmfXdAw9lbwOlBLuZmrZM1DM/WQJlJMPn3uuG+AHHGFX9agD18l5/42KJeyfeU RxnXgCsRzSFx1/SERl46OAoFg+LvdXsCBTiJxbZq5bKr707eD2GmBXHumMq8ZFZMnOAS EFXCMW6oNzcNk1R8vSkh2UGeBmDtbqEG8kJNPKyzxXAY8Cg3Z5PpaHGOzc+JrGaNuerN b5tfjdq+RZj6iGqypos/eNDlq5oeYDdJVWP2NSaqvuWkKi1fL4tm75EAgPpho6PpRKko VpcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742586355; x=1743191155; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W//AVeA/S/AgYB5djWx8LPevziOnuNP3pIFHfFSzRYk=; b=ujRICPvyCAUXzO1P/7DvmKIFRoWFHI/RsaIQTx2gXVmMmFtA7zZHrFRHYAazd92XHG YXhcb7OxufMXrStrs0BSVUTrl21VuALJGJwpVlAqZrJhQ7az+Ct6F9IJGPCPMVKi16qy 9Bvgrq/enFqwjUpzi6xZtr9aC4zKsXmXRiU4XcLpSgQPvCHzEv1Zc3K3/JDSPMvTSmds cI4RP1gOzJukFL7+F0Uz46c0zGVfKqurYptnKQtQqi/l/FzQUF+X82DiDIIWuVWY/cgz JSVRnmoe9Ts1nCcb1K4xA/9DOd6iV1SWQn6aIEeHAmr65rQ0omeiSFZyEN7i0R2jLpoo E4Gg== X-Gm-Message-State: AOJu0YwntigBOtfq9PczOhGeo6ZGKfYH3UvGakJxNRb9I7UJ4P/SQ7qw yaeP6dB6YyL9ZjF6G7hd5iRrCD66vxOxEoHAGyEIZyAkxRI3ouKaCvSuzHped+A= X-Gm-Gg: ASbGnctnL1Jnq28AxQ7PCERykdsVgUB4nyK/jjOYPXTky3ERQYJ2IyZyAOJFhgSLZPo sNEAj4J72u4Fq/ZGF6cyovPewm2CEEJoh4VUaN+Jg+AGDwHfgFvNF2o1d1WNAeIDNOClvqFM+Ee tMgBXWeMOAVYzQhedEPaWFPcFSgv72RGpokYSzRt3QxZEfC2MxCEkkDM2mbDpAmL3gaT3sdxmLI Z0Pd+WAMzGD8F4+Tw/eL/+lbD6ADLYa/Z/aq2cpp0xs0OyCzUIb7sz6mwuKJyXtssoyQLm1gUIC u1wI/P7ClgK6DxMkBbGcIj5BSl7y9Z/hieXEuuArXgpGMSzKLfmUxVxGclODmms42WYUk29pLWA yQByOXBcdX17NAg== X-Google-Smtp-Source: AGHT+IFXgW18czDQNdbmmVXgPIiDNHqzXnlZ1ZTQpWv7cFGGONwzvPUmnC06U9SVz3lpbYWsxGj0Qw== X-Received: by 2002:a05:6102:3ed3:b0:4c4:e0e0:f7bd with SMTP id ada2fe7eead31-4c50d5f1661mr4435609137.19.1742586354449; Fri, 21 Mar 2025 12:45:54 -0700 (PDT) Received: from lvondent-mobl5.. (syn-050-089-067-214.res.spectrum.com. [50.89.67.214]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-86f9f47a3a1sm519917241.33.2025.03.21.12.45.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Mar 2025 12:45:52 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v1 3/3] gatt-database: Fix always registering CentralAddressResolution Date: Fri, 21 Mar 2025 15:45:45 -0400 Message-ID: <20250321194545.1728631-3-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250321194545.1728631-1-luiz.dentz@gmail.com> References: <20250321194545.1728631-1-luiz.dentz@gmail.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Luiz Augusto von Dentz CentralAddressResolution shall be conditional to LL Privacy to avoid peripherals assuming Directed Advertising can be used which may lead to issues like: Fixes: https://github.com/bluez/bluez/issues/1138 --- lib/mgmt.h | 1 + src/gatt-database.c | 30 +++++++++++++++++------------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/lib/mgmt.h b/lib/mgmt.h index 6a397645bcf2..6af82fc4a1a5 100644 --- a/lib/mgmt.h +++ b/lib/mgmt.h @@ -104,6 +104,7 @@ struct mgmt_rp_read_index_list { #define MGMT_SETTING_CIS_PERIPHERAL BIT(19) #define MGMT_SETTING_ISO_BROADCASTER BIT(20) #define MGMT_SETTING_ISO_SYNC_RECEIVER BIT(21) +#define MGMT_SETTING_LL_PRIVACY BIT(22) #define MGMT_OP_READ_INFO 0x0004 struct mgmt_rp_read_info { diff --git a/src/gatt-database.c b/src/gatt-database.c index 239a0dc72be9..a5706e61ce1e 100644 --- a/src/gatt-database.c +++ b/src/gatt-database.c @@ -740,17 +740,14 @@ static void gap_car_read_cb(struct gatt_db_attribute *attrib, void *user_data) { uint8_t value = 0x00; + struct btd_device *device; DBG("GAP Central Address Resolution read request\n"); - if (btd_opts.defaults.le.addr_resolution) { - struct btd_device *device; - - device = btd_adapter_find_device_by_fd(bt_att_get_fd(att)); - if (device) - value = btd_device_flags_enabled(device, + device = btd_adapter_find_device_by_fd(bt_att_get_fd(att)); + if (device) + value = btd_device_flags_enabled(device, DEVICE_FLAG_ADDRESS_RESOLUTION); - } gatt_db_attribute_read_result(attrib, id, 0, &value, sizeof(value)); } @@ -873,10 +870,13 @@ static void populate_gap_service(struct btd_gatt_database *database) { bt_uuid_t uuid; struct gatt_db_attribute *service, *attrib; + bool ll_privacy = btd_adapter_has_settings(database->adapter, + MGMT_SETTING_LL_PRIVACY); /* Add the GAP service */ bt_uuid16_create(&uuid, UUID_GAP); - service = gatt_db_add_service(database->db, &uuid, true, 7); + service = gatt_db_add_service(database->db, &uuid, true, + ll_privacy ? 7 : 5); /* * Device Name characteristic. @@ -898,15 +898,19 @@ static void populate_gap_service(struct btd_gatt_database *database) NULL, database); gatt_db_attribute_set_fixed_length(attrib, 2); - /* - * Central Address Resolution characteristic. - */ - bt_uuid16_create(&uuid, GATT_CHARAC_CAR); - attrib = gatt_db_service_add_characteristic(service, &uuid, + /* Only enable Central Address Resolution if LL Privacy is supported */ + if (ll_privacy) { + /* + * Central Address Resolution characteristic. + */ + bt_uuid16_create(&uuid, GATT_CHARAC_CAR); + attrib = gatt_db_service_add_characteristic(service, &uuid, BT_ATT_PERM_READ, BT_GATT_CHRC_PROP_READ, gap_car_read_cb, NULL, database); + } + gatt_db_attribute_set_fixed_length(attrib, 1); gatt_db_service_set_active(service, true);