Diff between ea098a5aef730f038a63f4d21401a3e9694ff124 and e6f57ce4edf7a50042ca3fd25bc5e30bc60f37fd

Changed Files

File Additions Deletions Status
plugins/hciops.c +1 -1 modified
plugins/mgmtops.c +2 -1 modified
src/adapter.c +4 -2 modified
src/adapter.h +2 -2 modified
src/device.c +2 -1 modified

Full Patch

diff --git a/plugins/hciops.c b/plugins/hciops.c
index c51ddcf..1048bf6 100644
--- a/plugins/hciops.c
+++ b/plugins/hciops.c
@@ -3352,7 +3352,7 @@ static int hciops_get_conn_list(int index, GSList **conns)
 	return 0;
 }
 
-static int hciops_disconnect(int index, bdaddr_t *bdaddr)
+static int hciops_disconnect(int index, bdaddr_t *bdaddr, addr_type_t type)
 {
 	DBG("hci%d", index);
 
diff --git a/plugins/mgmtops.c b/plugins/mgmtops.c
index a2df3f7..c0af8d8 100644
--- a/plugins/mgmtops.c
+++ b/plugins/mgmtops.c
@@ -1818,7 +1818,7 @@ static int mgmt_get_conn_list(int index, GSList **conns)
 	return 0;
 }
 
-static int mgmt_disconnect(int index, bdaddr_t *bdaddr)
+static int mgmt_disconnect(int index, bdaddr_t *bdaddr, addr_type_t type)
 {
 	char buf[MGMT_HDR_SIZE + sizeof(struct mgmt_cp_disconnect)];
 	struct mgmt_hdr *hdr = (void *) buf;
@@ -1834,6 +1834,7 @@ static int mgmt_disconnect(int index, bdaddr_t *bdaddr)
 	hdr->index = htobs(index);
 
 	bacpy(&cp->addr.bdaddr, bdaddr);
+	cp->addr.type = mgmt_addr_type(type);
 
 	if (write(mgmt_sock, buf, sizeof(buf)) < 0)
 		error("write: %s (%d)", strerror(errno), errno);
diff --git a/src/adapter.c b/src/adapter.c
index e7c71b0..099b1c2 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -3509,9 +3509,11 @@ int btd_adapter_read_clock(struct btd_adapter *adapter, bdaddr_t *bdaddr,
 						timeout, clock, accuracy);
 }
 
-int btd_adapter_disconnect_device(struct btd_adapter *adapter, bdaddr_t *bdaddr)
+int btd_adapter_disconnect_device(struct btd_adapter *adapter,
+					bdaddr_t *bdaddr, addr_type_t type)
+
 {
-	return adapter_ops->disconnect(adapter->dev_id, bdaddr);
+	return adapter_ops->disconnect(adapter->dev_id, bdaddr, type);
 }
 
 int btd_adapter_remove_bonding(struct btd_adapter *adapter, bdaddr_t *bdaddr,
diff --git a/src/adapter.h b/src/adapter.h
index f83e412..f99eb19 100644
--- a/src/adapter.h
+++ b/src/adapter.h
@@ -196,7 +196,7 @@ struct btd_adapter_ops {
 	int (*block_device) (int index, bdaddr_t *bdaddr);
 	int (*unblock_device) (int index, bdaddr_t *bdaddr);
 	int (*get_conn_list) (int index, GSList **conns);
-	int (*disconnect) (int index, bdaddr_t *bdaddr);
+	int (*disconnect) (int index, bdaddr_t *bdaddr, addr_type_t type);
 	int (*remove_bonding) (int index, bdaddr_t *bdaddr, addr_type_t type);
 	int (*pincode_reply) (int index, bdaddr_t *bdaddr, const char *pin,
 							size_t pin_len);
@@ -248,7 +248,7 @@ int btd_adapter_block_address(struct btd_adapter *adapter, bdaddr_t *bdaddr);
 int btd_adapter_unblock_address(struct btd_adapter *adapter, bdaddr_t *bdaddr);
 
 int btd_adapter_disconnect_device(struct btd_adapter *adapter,
-							bdaddr_t *bdaddr);
+					bdaddr_t *bdaddr, addr_type_t type);
 
 int btd_adapter_remove_bonding(struct btd_adapter *adapter, bdaddr_t *bdaddr,
 							addr_type_t type);
diff --git a/src/device.c b/src/device.c
index c91e321..3803813 100644
--- a/src/device.c
+++ b/src/device.c
@@ -479,7 +479,8 @@ static gboolean do_disconnect(gpointer user_data)
 
 	device->disconn_timer = 0;
 
-	btd_adapter_disconnect_device(device->adapter, &device->bdaddr);
+	btd_adapter_disconnect_device(device->adapter, &device->bdaddr,
+								device->type);
 
 	return FALSE;
 }