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>
This commit is contained in:
Szymon Janc 2016-09-18 12:50:06 +02:00 committed by Marcel Holtmann
parent 2bb36870e8
commit 9c9db78dc0
1 changed files with 2 additions and 1 deletions

View File

@ -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))