summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-06-10 12:45:10 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2008-06-10 12:45:10 +0000
commit52d56d7260d763c7873ba550dac8cb4914bdd2fc (patch)
treeec2f7618724d4554a81886734db08ca0b1ccca4f
parenta715f1cb05569ff136bf277fe43e87a08b8a50f7 (diff)
Don't do pending authentication replies if we already got an authentication failure
-rw-r--r--hcid/dbus-hci.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/hcid/dbus-hci.c b/hcid/dbus-hci.c
index 20854087..f969b81a 100644
--- a/hcid/dbus-hci.c
+++ b/hcid/dbus-hci.c
@@ -873,6 +873,10 @@ static void pincode_cb(struct agent *agent, DBusError *err, const char *pincode,
size_t len;
int dev;
+ /* No need to reply anything if the authentication already failed */
+ if (adapter->bonding && adapter->bonding->hci_status)
+ return;
+
dev = hci_open_dev(adapter->dev_id);
if (dev < 0) {
error("hci_open_dev(%d): %s (%d)", adapter->dev_id,
@@ -949,6 +953,10 @@ static void confirm_cb(struct agent *agent, DBusError *err, void *user_data)
user_confirm_reply_cp cp;
int dd;
+ /* No need to reply anything if the authentication already failed */
+ if (adapter->bonding && adapter->bonding->hci_status)
+ return;
+
dd = hci_open_dev(adapter->dev_id);
if (dd < 0) {
error("Unable to open hci%d", adapter->dev_id);
@@ -977,6 +985,10 @@ static void passkey_cb(struct agent *agent, DBusError *err, uint32_t passkey,
bdaddr_t dba;
int dd;
+ /* No need to reply anything if the authentication already failed */
+ if (adapter->bonding && adapter->bonding->hci_status)
+ return;
+
dd = hci_open_dev(adapter->dev_id);
if (dd < 0) {
error("Unable to open hci%d", adapter->dev_id);