Re: [PATCH v1] Bluetooth: MGMT: Fix not exposing debug UUID on MGMT_OP_READ_EXP_FEATURES_INFO

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear Luiz,


Thank you for the patch.

Am 20.08.25 um 16:58 schrieb Luiz Augusto von Dentz:
From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

The debug UUID was only getting set if MGMT_OP_READ_EXP_FEATURES_INFO
was not called with a specific index which breaks the likes of
bluetoothd since it only invokes MGMT_OP_READ_EXP_FEATURES_INFO when an
adapter is plugged, so instead of depending hdev not to be set just
enable the UUID on any index like it was done with iso_sock_uuid.

Fixes: e625e50ceee1 ("Bluetooth: Introduce debug feature when dynamic debug is disabled")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>
---
  net/bluetooth/mgmt.c | 6 +-----
  1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 3166f5fb876b..2db93b70e07f 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -4413,13 +4413,11 @@ static int read_controller_cap(struct sock *sk, struct hci_dev *hdev,
  				 rp, sizeof(*rp) + cap_len);
  }
-#ifdef CONFIG_BT_FEATURE_DEBUG
  /* d4992530-b9ec-469f-ab01-6c481c47da1c */
  static const u8 debug_uuid[16] = {
  	0x1c, 0xda, 0x47, 0x1c, 0x48, 0x6c, 0x01, 0xab,
  	0x9f, 0x46, 0xec, 0xb9, 0x30, 0x25, 0x99, 0xd4,
  };
-#endif
/* 330859bc-7506-492d-9370-9a6f0614037f */
  static const u8 quality_report_uuid[16] = {
@@ -4468,15 +4466,13 @@ static int read_exp_features_info(struct sock *sk, struct hci_dev *hdev,
  	if (!rp)
  		return -ENOMEM;
-#ifdef CONFIG_BT_FEATURE_DEBUG
-	if (!hdev) {
+	if (IS_ENABLED(CONFIG_BT_FEATURE_DEBUG)) {
  		flags = bt_dbg_get() ? BIT(0) : 0;
memcpy(rp->features[idx].uuid, debug_uuid, 16);
  		rp->features[idx].flags = cpu_to_le32(flags);
  		idx++;
  	}
-#endif
if (hdev && hci_dev_le_state_simultaneous(hdev)) {
  		if (hci_dev_test_flag(hdev, HCI_LE_SIMULTANEOUS_ROLES))

Reviewed-by: Paul Menzel <pmenzel@xxxxxxxxxxxxx>


Kind regards,

Paul




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux