OSDN Git Service

core: Fix canceling pairing through mgmt
authorJohan Hedberg <johan.hedberg@intel.com>
Tue, 22 Jan 2013 12:57:18 +0000 (14:57 +0200)
committerJohan Hedberg <johan.hedberg@intel.com>
Tue, 22 Jan 2013 12:57:18 +0000 (14:57 +0200)
The mgmt_reply() function should be used instead of mgmt_send() since
otherwise the request obeys the usual command queuing which wont work
due to the pending mgmt_pair_device command.

src/adapter.c

index 75ce4e8..5fd5062 100644 (file)
@@ -4723,7 +4723,7 @@ int adapter_cancel_bonding(struct btd_adapter *adapter, const bdaddr_t *bdaddr,
        bacpy(&cp.bdaddr, bdaddr);
        cp.type = addr_type;
 
-       if (mgmt_send(adapter->mgmt, MGMT_OP_CANCEL_PAIR_DEVICE,
+       if (mgmt_reply(adapter->mgmt, MGMT_OP_CANCEL_PAIR_DEVICE,
                                adapter->dev_id, sizeof(cp), &cp,
                                NULL, NULL, NULL) > 0)
                return 0;