mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 08:31:13 +00:00
Bluetooth: mgmt: Add local name information to read_info reply
This patch adds the name of the adapter to the reply of the read_info management command. The management messages reserve 249 bytes for the name instead of 248 (like in the HCI spec) so that there is always a guarantee that it is nul-terminated. That way it can safely be passed onto string manipulation functions. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
This commit is contained in:
parent
1f6c6378c5
commit
dc4fe30b86
2 changed files with 9 additions and 0 deletions
|
@ -183,6 +183,8 @@ static int read_controller_info(struct sock *sk, u16 index)
|
|||
|
||||
set_bit(HCI_MGMT, &hdev->flags);
|
||||
|
||||
memset(&rp, 0, sizeof(rp));
|
||||
|
||||
rp.type = hdev->dev_type;
|
||||
|
||||
rp.powered = test_bit(HCI_UP, &hdev->flags);
|
||||
|
@ -204,6 +206,8 @@ static int read_controller_info(struct sock *sk, u16 index)
|
|||
rp.hci_ver = hdev->hci_ver;
|
||||
put_unaligned_le16(hdev->hci_rev, &rp.hci_rev);
|
||||
|
||||
memcpy(rp.name, hdev->dev_name, sizeof(hdev->dev_name));
|
||||
|
||||
hci_dev_unlock_bh(hdev);
|
||||
hci_dev_put(hdev);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue