Skip to content

Commit

Permalink
Bluetooth: Use whitelist for scan policy when suspending
Browse files Browse the repository at this point in the history
Even with one advertisement monitor in place, the scan policy should use
the whitelist while the system is going to suspend to prevent waking by
random advertisement.

The following test was performed.
- With a paired device, register one advertisement monitor, suspend
the system and verify that the host was not awaken by random
advertisements.

Signed-off-by: Miao-chen Chou <[email protected]>
Reviewed-by: Abhishek Pandit-Subedi <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
  • Loading branch information
mcchou-cr authored and holtmann committed Jul 8, 2020
1 parent 15d8ce0 commit 51b64c4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/bluetooth/hci_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -800,9 +800,10 @@ static u8 update_white_list(struct hci_request *req)

/* Once the controller offloading of advertisement monitor is in place,
* the if condition should include the support of MSFT extension
* support.
* support. If suspend is ongoing, whitelist should be the default to
* prevent waking by random advertisements.
*/
if (!idr_is_empty(&hdev->adv_monitors_idr))
if (!idr_is_empty(&hdev->adv_monitors_idr) && !hdev->suspended)
return 0x00;

/* Select filter policy to use white list */
Expand Down

0 comments on commit 51b64c4

Please sign in to comment.