Fix problem with server storage.

This commit is contained in:
Luiz Augusto von Dentz 2007-09-28 13:37:54 +00:00
parent b9b690ea90
commit a558e0071f
2 changed files with 9 additions and 7 deletions

View File

@ -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));
}

View File

@ -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)