diff options
author | Andre Guedes <andre.guedes@openbossa.org> | 2013-04-30 15:29:40 -0300 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2013-06-23 00:23:52 +0100 |
commit | 12602d0cc005354a519b3eba443d7912ab71313a (patch) | |
tree | c772ba1de92fec5555771af4376c2199a8561da5 /net/bluetooth | |
parent | 8892d8beb37cb4ea531a5076946d5cc809b04c25 (diff) | |
download | op-kernel-dev-12602d0cc005354a519b3eba443d7912ab71313a.zip op-kernel-dev-12602d0cc005354a519b3eba443d7912ab71313a.tar.gz |
Bluetooth: Mgmt Device Found Event
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>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/mgmt.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 69d1720..7ae737f 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -4180,6 +4180,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; |