summaryrefslogtreecommitdiffstats
path: root/hcid/dbus-hci.c
diff options
context:
space:
mode:
Diffstat (limited to 'hcid/dbus-hci.c')
-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);