From bcb6af7fc78234948ba1c997825c8859464b170b Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 13 Jan 2009 17:29:53 +0200 Subject: Don't do reverse SDP for renewed link keys Add a flag for a renewed link key to the device struct so that when we get authentication complete we don't do reverse SDP or PropertyChanged(Paired, true) if a new bonding isn't being created. --- src/device.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/device.c') diff --git a/src/device.c b/src/device.c index b6d8695f..ba705288 100644 --- a/src/device.c +++ b/src/device.c @@ -110,6 +110,8 @@ struct btd_device { gboolean secmode3; sdp_list_t *tmp_records; + + gboolean renewed_key; }; struct browse_req { @@ -1814,6 +1816,12 @@ void device_bonding_complete(struct btd_device *device, uint8_t status) device->temporary = FALSE; + g_free(device->authr); + device->authr = NULL; + + if (device->renewed_key) + return; + /* If we were initiators start service discovery immediately. * However if the other end was the initator wait a few seconds * before SDP. This is due to potential IOP issues if the other @@ -1838,8 +1846,6 @@ void device_bonding_complete(struct btd_device *device, uint8_t status) device_set_paired(device, TRUE); - g_free(device->authr); - device->authr = NULL; bonding_request_free(bonding); return; @@ -2040,6 +2046,11 @@ gboolean device_is_authenticating(struct btd_device *device) return (device->authr != NULL); } +void device_set_renewed_key(struct btd_device *device, gboolean renewed) +{ + device->renewed_key = renewed; +} + void btd_device_add_uuid(struct btd_device *device, const char *uuid) { GSList *uuid_list; -- cgit