summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2009-05-27 11:24:36 -0300
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2009-05-27 11:25:24 -0300
commit5e5fbd39b64ff0ad84e9be9a51daa020638e679b (patch)
treef94df5820ef2b06f9326cdbd3027a4d49fa271fc /src
parent5bbba242838ffad18d87209fd1b3c3497bc09416 (diff)
downloadbluez-5e5fbd39b64ff0ad84e9be9a51daa020638e679b.tar.gz
Fix regression which cause device object to be remove after paired.
Device was not being set to permanent when acting as acceptor of bonding process.
Diffstat (limited to 'src')
-rw-r--r--src/dbus-hci.c5
-rw-r--r--src/device.c24
2 files changed, 16 insertions, 13 deletions
diff --git a/src/dbus-hci.c b/src/dbus-hci.c
index 65ac12ba9..37143cf20 100644
--- a/src/dbus-hci.c
+++ b/src/dbus-hci.c
@@ -844,11 +844,6 @@ int hcid_dbus_link_key_notify(bdaddr_t *local, bdaddr_t *peer,
error("write_link_key: %s (%d)", strerror(-err), -err);
return err;
}
-
- /* If not the initiator consider the device permanent otherwise
- * wait to service discover to complete */
- if (!bonding)
- device_set_temporary(device, FALSE);
}
/* If this is not the first link key set a flag so a subsequent auth
diff --git a/src/device.c b/src/device.c
index 8c34c6048..27f0bf818 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1950,14 +1950,22 @@ void device_bonding_complete(struct btd_device *device, uint8_t status)
device_browse(device, bonding->conn, bonding->msg,
NULL, FALSE);
- } else if (!device->browse && !device->discov_timer &&
- main_opts.reverse_sdp) {
- /* If we are not initiators and there is no currently active
- * discovery or discovery timer, set the discovery timer */
- debug("setting timer for reverse service discovery");
- device->discov_timer = g_timeout_add_seconds(DISCOVERY_TIMER,
- start_discovery,
- device);
+ } else {
+ /* If not the initiator consider the device permanent otherwise
+ * wait to service discover to complete */
+ device_set_temporary(device, FALSE);
+
+ if (!device->browse && !device->discov_timer &&
+ main_opts.reverse_sdp) {
+ /* If we are not initiators and there is no currently
+ * active discovery or discovery timer, set discovery
+ * timer */
+ debug("setting timer for reverse service discovery");
+ device->discov_timer = g_timeout_add_seconds(
+ DISCOVERY_TIMER,
+ start_discovery,
+ device);
+ }
}
device_set_paired(device, TRUE);