summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_core.c
diff options
context:
space:
mode:
authorJohan Hedberg2010-05-18 13:20:32 +0200
committerMarcel Holtmann2010-07-21 19:39:05 +0200
commitf03585689fdff4ae256edd45a35bc2dd83d3684a (patch)
treebe1516aa354aa742f2d5b69a91de0561febaffc4 /net/bluetooth/hci_core.c
parentBluetooth: Fix L2CAP control bit field corruption (diff)
downloadkernel-qcow2-linux-f03585689fdff4ae256edd45a35bc2dd83d3684a.tar.gz
kernel-qcow2-linux-f03585689fdff4ae256edd45a35bc2dd83d3684a.tar.xz
kernel-qcow2-linux-f03585689fdff4ae256edd45a35bc2dd83d3684a.zip
Bluetooth: Add blacklist support for incoming connections
In some circumstances it could be desirable to reject incoming connections on the baseband level. This patch adds this feature through two new ioctl's: HCIBLOCKADDR and HCIUNBLOCKADDR. Both take a simple Bluetooth address as a parameter. BDADDR_ANY can be used with HCIUNBLOCKADDR to remove all devices from the blacklist. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_core.c')
-rw-r--r--net/bluetooth/hci_core.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 2f768de87011..aeb2982310a0 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -562,6 +562,7 @@ static int hci_dev_do_close(struct hci_dev *hdev)
hci_dev_lock_bh(hdev);
inquiry_cache_flush(hdev);
hci_conn_hash_flush(hdev);
+ hci_blacklist_clear(hdev);
hci_dev_unlock_bh(hdev);
hci_notify(hdev, HCI_DEV_DOWN);
@@ -923,6 +924,8 @@ int hci_register_dev(struct hci_dev *hdev)
hci_conn_hash_init(hdev);
+ INIT_LIST_HEAD(&hdev->blacklist.list);
+
memset(&hdev->stat, 0, sizeof(struct hci_dev_stats));
atomic_set(&hdev->promisc, 0);