summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2006-08-18 23:32:01 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2006-08-18 23:32:01 +0000
commit37726232053804e18cb5c34e6dec42a8427240a2 (patch)
tree1e27151d3cb420b2546a76710a77c2adcd3e6a77
parent9f3d6b792cda3e1473112331c4aeb116906fc5a1 (diff)
Cancel agent requests on DEVDOWN
-rw-r--r--hcid/dbus-security.c4
-rw-r--r--hcid/dbus.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/hcid/dbus-security.c b/hcid/dbus-security.c
index d2d634e6..f7b409e6 100644
--- a/hcid/dbus-security.c
+++ b/hcid/dbus-security.c
@@ -569,7 +569,7 @@ void cancel_passkey_agent_requests(struct slist *agents, const char *path, bdadd
for (l = default_agent->pending_requests; l != NULL; l = next) {
struct pending_agent_request *req = l->data;
next = l->next;
- if (!strcmp(path, req->path) && !bacmp(addr, &req->bda)) {
+ if (!strcmp(path, req->path) && (!addr || !bacmp(addr, &req->bda))) {
send_cancel_request(default_agent, req);
default_agent->pending_requests = slist_remove(default_agent->pending_requests,
req);
@@ -582,7 +582,7 @@ void cancel_passkey_agent_requests(struct slist *agents, const char *path, bdadd
for (l = agent->pending_requests; l != NULL; l = next) {
struct pending_agent_request *req = l->data;
next = l->next;
- if (!strcmp(path, req->path) && !bacmp(addr, &req->bda)) {
+ if (!strcmp(path, req->path) && (!addr || !bacmp(addr, &req->bda))) {
send_cancel_request(agent, req);
agent->pending_requests = slist_remove(agent->pending_requests, req);
}
diff --git a/hcid/dbus.c b/hcid/dbus.c
index 696211d5..6e174ab3 100644
--- a/hcid/dbus.c
+++ b/hcid/dbus.c
@@ -635,6 +635,8 @@ int hcid_dbus_stop_device(uint16_t id)
/* check pending requests */
reply_pending_requests(path, pdata);
+ cancel_passkey_agent_requests(pdata->passkey_agents, path, NULL);
+
if (pdata->requestor_name) {
free(pdata->requestor_name);
pdata->requestor_name = NULL;