mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-07 10:01:00 +01:00
Bluetooth: Add white list lookup for incoming connection requests
This patch adds support for looking up entries in the white list when HCI_CONNECTABLE is not set. The logic is fairly simple: if we're connectable check the black list, if we're not connectable check the white list. Signed-off-by: Johan Hedberg <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
This commit is contained in:
1 parent
6cebb9e73a
commit
a55bd29d52
1 file changed
+12
-4
@@ -2149,10 +2149,18 @@ static void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!hci_bdaddr_list_lookup(&hdev->blacklist, &ev->bdaddr,
|
||||
BDADDR_BREDR)) {
|
||||
hci_reject_conn(hdev, &ev->bdaddr);
|
||||
return;
|
||||
if (test_bit(HCI_CONNECTABLE, &hdev->dev_flags)) {
|
||||
if (hci_bdaddr_list_lookup(&hdev->blacklist, &ev->bdaddr,
|
||||
BDADDR_BREDR)) {
|
||||
hci_reject_conn(hdev, &ev->bdaddr);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (!hci_bdaddr_list_lookup(&hdev->whitelist, &ev->bdaddr,
|
||||
BDADDR_BREDR)) {
|
||||
hci_reject_conn(hdev, &ev->bdaddr);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Connection accepted */
|
||||
|
||||
Reference in new issue
Block a user