Skip to content

Commit

Permalink
Bluetooth: Fix advertising instance validity check for flags
Browse files Browse the repository at this point in the history
Flags are not allowed in Scan Response.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Szymon Janc authored and Marcel Holtmann committed Sep 19, 2016
1 parent 2bb3687 commit 9c9db78
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 9c9db78

Please sign in to comment.