]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
Bluetooth: Add missing hci_skb_opcode for raw socket commands
authorMarcel Holtmann <marcel@holtmann.org>
Fri, 6 Nov 2015 06:42:20 +0000 (07:42 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 19 Nov 2015 16:50:27 +0000 (17:50 +0100)
When HCI commands are injected via the raw socket, the core was not
including the decoded opcode value. So ensure that it is actually set.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
net/bluetooth/hci_sock.c

index 19b23013c4f668341b1f80435d696d98da156db1..32caa6271a923a98de8637e9b8357c6c73f0a8ff 100644 (file)
@@ -1242,6 +1242,11 @@ static int hci_sock_sendmsg(struct socket *sock, struct msghdr *msg,
                        goto drop;
                }
 
+               /* Since the opcode has already been extracted here, store
+                * a copy of the value for later use by the drivers.
+                */
+               hci_skb_opcode(skb) = opcode;
+
                if (ogf == 0x3f) {
                        skb_queue_tail(&hdev->raw_q, skb);
                        queue_work(hdev->workqueue, &hdev->tx_work);