]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Bluetooth: Mgmt Device Found Event
authorAndre Guedes <andre.guedes@openbossa.org>
Tue, 30 Apr 2013 18:29:40 +0000 (15:29 -0300)
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>
Wed, 29 May 2013 21:43:41 +0000 (18:43 -0300)
We only want to send Mgmt Device Found Events if we are running the
Device Discovery procedure (started by the MGMT Start Discovery
Command). Inquiry or LE scanning triggered by HCI raw interface (e.g.
hcitool) or kernel internals should not send Mgmt Device Found Events.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Acked-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
net/bluetooth/mgmt.c

index 83db6e8d77ae010a9a9cbd39bceec9a76e04d30f..8567764aea763c8b432e34d10fa9f26440fd45f0 100644 (file)
@@ -4159,6 +4159,9 @@ int mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
        struct mgmt_ev_device_found *ev = (void *) buf;
        size_t ev_size;
 
+       if (!hci_discovery_active(hdev))
+               return -EPERM;
+
        /* Leave 5 bytes for a potential CoD field */
        if (sizeof(*ev) + eir_len + 5 > sizeof(buf))
                return -EINVAL;