diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2016-04-07 21:01:27 +0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2016-04-08 18:51:44 +0200 |
commit | 56b40fbf61a247e23b50e426971148b2e50262e0 (patch) | |
tree | ed77f6fbcbedfaebf71912a7bdf85ade50548f5d /net/bluetooth/hci_event.c | |
parent | f18ba58f538e44a701ad0b86d47bb57b917d7c0a (diff) | |
download | op-kernel-dev-56b40fbf61a247e23b50e426971148b2e50262e0.zip op-kernel-dev-56b40fbf61a247e23b50e426971148b2e50262e0.tar.gz |
Bluetooth: Ignore unknown advertising packet types
In case of buggy controllers send advertising packet types that we
don't know of we should simply ignore them instead of trying to react
to them in some (potentially wrong) way.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r-- | net/bluetooth/hci_event.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index c162af5..d4b3dd5 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -4727,6 +4727,19 @@ static void process_adv_report(struct hci_dev *hdev, u8 type, bdaddr_t *bdaddr, u32 flags; u8 *ptr, real_len; + switch (type) { + case LE_ADV_IND: + case LE_ADV_DIRECT_IND: + case LE_ADV_SCAN_IND: + case LE_ADV_NONCONN_IND: + case LE_ADV_SCAN_RSP: + break; + default: + BT_ERR_RATELIMITED("Unknown advetising packet type: 0x%02x", + type); + return; + } + /* Find the end of the data in case the report contains padded zero * bytes at the end causing an invalid length value. * |