summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/mgmt.c
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@codecoup.pl>2016-09-18 12:50:06 +0200
committerMarcel Holtmann <marcel@holtmann.org>2016-09-19 20:19:34 +0200
commit9c9db78dc0fbbd95177fefdad008e46ffaa777f2 (patch)
treec190c9df37b5fbe6f11df7871b04e52d37fa74e9 /net/bluetooth/mgmt.c
parent2bb36870e8cb29949ef9acec37129cd8e70f1857 (diff)
downloadlinux-9c9db78dc0fbbd95177fefdad008e46ffaa777f2.tar.bz2
Bluetooth: Fix advertising instance validity check for flags
Flags are not allowed in Scan Response. Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r--net/bluetooth/mgmt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index c96b0adc4971..2758c6a4425c 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -6065,7 +6065,8 @@ static bool tlv_data_is_valid(u32 adv_flags, u8 *data, u8 len, bool is_adv_data)
for (i = 0, cur_len = 0; i < len; i += (cur_len + 1)) {
cur_len = data[i];
- if (data[i + 1] == EIR_FLAGS && flags_managed(adv_flags))
+ if (data[i + 1] == EIR_FLAGS &&
+ (!is_adv_data || flags_managed(adv_flags)))
return false;
if (data[i + 1] == EIR_TX_POWER && tx_power_managed(adv_flags))