From 52d56d7260d763c7873ba550dac8cb4914bdd2fc Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 10 Jun 2008 12:45:10 +0000 Subject: Don't do pending authentication replies if we already got an authentication failure --- hcid/dbus-hci.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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); -- cgit