diff options
-rw-r--r-- | network/manager.c | 11 | ||||
-rw-r--r-- | network/server.c | 5 |
2 files changed, 9 insertions, 7 deletions
diff --git a/network/manager.c b/network/manager.c index 355b9665..683ff0a0 100644 --- a/network/manager.c +++ b/network/manager.c @@ -825,17 +825,16 @@ static void register_server(uint16_t id) return; bacpy(&src, BDADDR_ANY); + dev_id = hci_get_route(&src); + if (dev_id < 0) + return; - dev_id = hci_get_route(NULL); - - if (dev_id >= 0) - hci_devba(dev_id, &src); + hci_devba(dev_id, &src); if (server_register(path, &src, id) < 0) return; - if (bacmp(&src, BDADDR_ANY) != 0) - server_store(path); + server_store(path); server_paths = g_slist_append(server_paths, g_strdup(path)); } diff --git a/network/server.c b/network/server.c index 6ac7789f..702c8fb3 100644 --- a/network/server.c +++ b/network/server.c @@ -1139,6 +1139,7 @@ int server_register(const char *path, bdaddr_t *src, uint16_t id) ns->name = g_strdup("BlueZ PANU service"); ns->path = g_strdup(path); + ns->id = id; bacpy(&ns->src, src); info("Registered server path:%s", path); @@ -1205,8 +1206,10 @@ int server_store(const char *path) char addr[18]; if (!dbus_connection_get_object_user_data(connection, - path, (void *) &ns)) + path, (void *) &ns)) { + error("Unable to salve %s on storage", path); return -ENOENT; + } ba2str(&ns->src, addr); if (ns->id == BNEP_SVC_NAP) |