OSDN Git Service

core: Disable unnecessary auto connections
authorPaulo Alcantara <paulo.alcantara@openbossa.org>
Tue, 2 Oct 2012 17:22:55 +0000 (14:22 -0300)
committerJohan Hedberg <johan.hedberg@intel.com>
Wed, 3 Oct 2012 07:50:54 +0000 (10:50 +0300)
BlueZ host disconnects the link when encryption fails. ECONNABORTED
error is returned by the kernel when the connection is terminated by the
local host. This scenario commonly happens when authentication fails due
PIN or Key Missing.

src/device.c

index 7221f93..d28adeb 100644 (file)
@@ -2044,6 +2044,9 @@ static void att_error_cb(const GError *gerr, gpointer user_data)
        struct att_callbacks *attcb = user_data;
        struct btd_device *device = attcb->user_data;
 
+       if (g_error_matches(gerr, BT_IO_ERROR, ECONNABORTED))
+               return;
+
        if (device->auto_connect == FALSE)
                return;