From 675a0e69398d038ac64ff9e466f48ceda1fb6da9 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 15 Sep 2006 15:29:27 +0000 Subject: Close the L2CAP raw socket only after the PIN request has been replied to --- hcid/dbus-adapter.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hcid/dbus-adapter.c b/hcid/dbus-adapter.c index 907b81db..80da4ef8 100644 --- a/hcid/dbus-adapter.c +++ b/hcid/dbus-adapter.c @@ -1951,8 +1951,6 @@ static DBusHandlerResult handle_dev_cancel_bonding_req(DBusConnection *conn, DBu dbus_data->bonding->cancel = 1; - g_io_channel_close(dbus_data->bonding->io); - l = slist_find(dbus_data->pin_reqs, &peer_bdaddr, pin_req_cmp); if (l) { struct pending_pin_info *pin_req = l->data; @@ -1963,6 +1961,7 @@ static DBusHandlerResult handle_dev_cancel_bonding_req(DBusConnection *conn, DBu * was already replied it doesn't make sense cancel the * remote passkey: return not authorized. */ + g_io_channel_close(dbus_data->bonding->io); return error_not_authorized(conn, msg); } else { int dd = hci_open_dev(dbus_data->dev_id); @@ -1981,6 +1980,8 @@ static DBusHandlerResult handle_dev_cancel_bonding_req(DBusConnection *conn, DBu free(pin_req); } + g_io_channel_close(dbus_data->bonding->io); + reply = dbus_message_new_method_return(msg); send_reply_and_unref(conn, reply); -- cgit