summaryrefslogtreecommitdiffstats
path: root/src/dbus-hci.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-10-08 23:54:10 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2008-10-08 23:54:10 +0200
commite4d0a3b9051923b015ce633f9385e5af126211fe (patch)
tree18f5a41d529123e5409e4d8ffcbb6b4369ee8dc8 /src/dbus-hci.c
parenta4145c63530b4c3575b7da5f117c0df352f939fc (diff)
Fix the service discovery-upon-pairing logic
The original code seems to try to handle the situation of two opposite directed pairing attempts (remote side starts dedicated bonding with us but someone calls CreatePairedDevice on our side at the same time). I'm not sure how likely this actually is or if it can even succeed, but the existing logic in the code was nevertheless wrong. After this patch is at least in theory makes sense to me (and is better commented if I forget what I was thinking when I wrote it).
Diffstat (limited to 'src/dbus-hci.c')
-rw-r--r--src/dbus-hci.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dbus-hci.c b/src/dbus-hci.c
index 2ae307e8..3abf6bdc 100644
--- a/src/dbus-hci.c
+++ b/src/dbus-hci.c
@@ -611,7 +611,8 @@ void hcid_dbus_bonding_process_complete(bdaddr_t *local, bdaddr_t *peer,
/* If this is a new pairing send the appropriate signal for it
* and proceed with service discovery */
if (status == 0) {
- if (device_set_paired(connection, device, bonding) && bonding)
+ device_set_paired(connection, device, bonding);
+ if (bonding)
adapter_free_bonding_request(adapter);
return;
}