mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2025-01-26 22:33:29 +08:00
Fix problem with server storage.
This commit is contained in:
parent
b9b690ea90
commit
a558e0071f
@ -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));
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user