Bluetooth: Add support for notifying userspace of new LTK's
authorVinicius Costa Gomes <vinicius.gomes@openbossa.org>
Fri, 3 Feb 2012 00:08:05 +0000 (21:08 -0300)
committerJohan Hedberg <johan.hedberg@intel.com>
Mon, 13 Feb 2012 15:01:33 +0000 (17:01 +0200)
If we want to have proper pairing support over LE we need to
inform userspace that a new LTK is available, so userspace
can store that key permanently.

Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
net/bluetooth/hci_core.c

index 84b7a9e4f2f6dd9afc9978f0bd70368b4392d975..76dc1538e321650a7c76c43ae8714ef096a6c750 100644 (file)
@@ -1338,6 +1338,9 @@ int hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 addr_type, u8 type,
        if (!new_key)
                return 0;
 
+       if (type & HCI_SMP_LTK)
+               mgmt_new_ltk(hdev, key, 1);
+
        return 0;
 }