summaryrefslogtreecommitdiffstats
path: root/network
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2007-09-28 13:37:54 +0000
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2007-09-28 13:37:54 +0000
commita558e0071fe657965e0b3928d72fd2318aa03087 (patch)
treecc65535e506a13d35ad6afffe4dd1e5b4780d767 /network
parentb9b690ea90c9aa0519f4d86eb1e82f7198d710f2 (diff)
Fix problem with server storage.
Diffstat (limited to 'network')
-rw-r--r--network/manager.c11
-rw-r--r--network/server.c5
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)