aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAndre Guedes <andre.guedes@openbossa.org>2013-04-30 14:29:40 -0400
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2013-06-22 19:23:52 -0400
commit12602d0cc005354a519b3eba443d7912ab71313a (patch)
treec772ba1de92fec5555771af4376c2199a8561da5 /net
parent8892d8beb37cb4ea531a5076946d5cc809b04c25 (diff)
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')
-rw-r--r--net/bluetooth/mgmt.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 69d17205745b..7ae737fcf5e7 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,
4180 struct mgmt_ev_device_found *ev = (void *) buf; 4180 struct mgmt_ev_device_found *ev = (void *) buf;
4181 size_t ev_size; 4181 size_t ev_size;
4182 4182
4183 if (!hci_discovery_active(hdev))
4184 return -EPERM;
4185
4183 /* Leave 5 bytes for a potential CoD field */ 4186 /* Leave 5 bytes for a potential CoD field */
4184 if (sizeof(*ev) + eir_len + 5 > sizeof(buf)) 4187 if (sizeof(*ev) + eir_len + 5 > sizeof(buf))
4185 return -EINVAL; 4188 return -EINVAL;