summaryrefslogtreecommitdiffstats
path: root/hcid/dbus-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'hcid/dbus-manager.c')
-rw-r--r--hcid/dbus-manager.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/hcid/dbus-manager.c b/hcid/dbus-manager.c
index 68c732f5..695b3112 100644
--- a/hcid/dbus-manager.c
+++ b/hcid/dbus-manager.c
@@ -103,6 +103,7 @@ static DBusHandlerResult find_adapter(DBusConnection *conn,
{
DBusMessage *reply;
char path[MAX_PATH_LENGTH], *path_ptr = path;
+ struct hci_dev_info di;
const char *pattern;
int dev_id;
@@ -115,6 +116,12 @@ static DBusHandlerResult find_adapter(DBusConnection *conn,
if (dev_id < 0)
return error_no_such_adapter(conn, msg);
+ if (hci_devinfo(dev_id, &di) < 0)
+ return error_no_such_adapter(conn, msg);
+
+ if (hci_test_bit(HCI_RAW, &di.flags))
+ return error_no_such_adapter(conn, msg);
+
reply = dbus_message_new_method_return(msg);
if (!reply)
return DBUS_HANDLER_RESULT_NEED_MEMORY;
@@ -177,6 +184,9 @@ static DBusHandlerResult list_adapters(DBusConnection *conn,
if (hci_devinfo(dr->dev_id, &di) < 0)
continue;
+ if (hci_test_bit(HCI_RAW, &di.flags))
+ continue;
+
snprintf(path, sizeof(path), "%s/%s", BASE_PATH, di.name);
dbus_message_iter_append_basic(&array_iter,