summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2010-07-12 14:12:20 -0300
committerJohan Hedberg <johan.hedberg@nokia.com>2010-07-12 14:14:01 -0300
commitfccdf4a50765ef5a2dbde00d95f65e94ce0a543b (patch)
tree008649b66347e4ebcb9efb9858ff00fa678be329
parent6e6252937e1e77dcae13467f63b25b043ea03f63 (diff)
downloadbluez-fccdf4a50765ef5a2dbde00d95f65e94ce0a543b.tar.gz
Fix initialization of adapters in RAW mode
Make sure bluetoothd completely ignores any adapters with the RAW flag set. This means that neither start_security_manager nor manager_start_adapter should be called for such an adapter.
-rw-r--r--plugins/hciops.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/plugins/hciops.c b/plugins/hciops.c
index 35cba0ec0..5775cf149 100644
--- a/plugins/hciops.c
+++ b/plugins/hciops.c
@@ -76,7 +76,7 @@ static void at_child_exit(void)
error("unable to write to child pipe");
}
-static void configure_device(int index)
+static void device_devup_setup(int index)
{
struct hci_dev_info di;
uint16_t policy;
@@ -111,6 +111,12 @@ static void configure_device(int index)
OCF_WRITE_DEFAULT_LINK_POLICY, 2, &policy);
hci_close_dev(dd);
+
+ start_security_manager(index);
+
+ /* Return value 1 means ioctl(DEVDOWN) was performed */
+ if (manager_start_adapter(index) == 1)
+ stop_security_manager(index);
}
static void init_device(int index)
@@ -202,17 +208,6 @@ static void device_devreg_setup(int index)
manager_register_adapter(index, devup);
}
-static void device_devup_setup(int index)
-{
- configure_device(index);
-
- start_security_manager(index);
-
- /* Return value 1 means ioctl(DEVDOWN) was performed */
- if (manager_start_adapter(index) == 1)
- stop_security_manager(index);
-}
-
static void device_event(int event, int index)
{
switch (event) {