[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CABBYNZK1eqfS8Ro8xZXpt-VhfzxxYepkqZamXkipKPGscg6Y8Q@mail.gmail.com>
Date: Thu, 29 Feb 2024 09:14:22 -0500
From: Luiz Augusto von Dentz <luiz.dentz@...il.com>
To: clancy_shang@....com
Cc: marcel@...tmann.org, johan.hedberg@...il.com,
linux-bluetooth@...r.kernel.org, linux-kernel@...r.kernel.org,
zhongjun.yu@...ctel.com, Clancy Shang <clancy.shang@...ctel.com>
Subject: Re: [PATCH] Bluetooth: mgmt: Fix wrong param be used
Hi,
On Thu, Feb 29, 2024 at 3:41 AM <clancy_shang@....com> wrote:
>
> From: Clancy Shang <clancy.shang@...ctel.com>
>
> if the BlueZ library calls the API interface "adapter_set_device_flags",
> which sends the "MGMT_OP_SET_DEVICE_FLAGS" opcode to the kernel, but
> does not receive the callback message "MGMT_EV_DEVICE_FLAGS_CHANGED"
> from the kernel. it fixs this bug.
Please stop sending this change, the client who sent
MGMT_OP_SET_DEVICE_FLAGS is not supposed to get
MGMT_EV_DEVICE_FLAGS_CHANGED back:
https://github.com/bluez/bluez/blob/master/doc/mgmt-api.txt#L4975
If there is a problem with that then perhaps it is in userspace not
setting the flag on command complete.
> Signed-off-by: Clancy Shang <clancy.shang@...ctel.com>
> ---
> net/bluetooth/mgmt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
> index 9dd815b6603f..c74abdf3618f 100644
> --- a/net/bluetooth/mgmt.c
> +++ b/net/bluetooth/mgmt.c
> @@ -5177,7 +5177,7 @@ static int set_device_flags(struct sock *sk, struct hci_dev *hdev, void *data,
>
> done:
> if (status == MGMT_STATUS_SUCCESS)
> - device_flags_changed(sk, hdev, &cp->addr.bdaddr, cp->addrtype,
> + device_flags_changed(NULL, hdev, &cp->addr.bdaddr, cp->addr.type,
> supported_flags, current_flags);
>
> return mgmt_cmd_complete(sk, hdev->id, MGMT_OP_SET_DEVICE_FLAGS, status,
> --
> 2.25.1
>
--
Luiz Augusto von Dentz
Powered by blists - more mailing lists