Diff between 39609deec701e747a488e4fa86f9a18763952b20 and 4ba06534140e04c134154cc2682f2a1ec4d0d007

Changed Files

File Additions Deletions Status
mgmt/main.c +7 -3 modified

Full Patch

diff --git a/mgmt/main.c b/mgmt/main.c
index 93c42fd..e9b0ee1 100644
--- a/mgmt/main.c
+++ b/mgmt/main.c
@@ -1096,14 +1096,18 @@ static void find_rsp(int mgmt_sk, uint16_t op, uint16_t id, uint8_t status,
 static void cmd_find(int mgmt_sk, uint16_t index, int argc, char **argv)
 {
 	struct mgmt_cp_start_discovery cp;
+	uint8_t type;
 
 	if (index == MGMT_INDEX_NONE)
 		index = 0;
 
+	type = 0;
+	hci_set_bit(MGMT_ADDR_BREDR, &type);
+	hci_set_bit(MGMT_ADDR_LE_PUBLIC, &type);
+	hci_set_bit(MGMT_ADDR_LE_RANDOM, &type);
+
 	memset(&cp, 0, sizeof(cp));
-	hci_set_bit(MGMT_ADDR_BREDR, &cp.type);
-	hci_set_bit(MGMT_ADDR_LE_PUBLIC, &cp.type);
-	hci_set_bit(MGMT_ADDR_LE_RANDOM, &cp.type);
+	cp.type = type;
 
 	if (mgmt_send_cmd(mgmt_sk, MGMT_OP_START_DISCOVERY, index,
 				&cp, sizeof(cp), find_rsp, NULL) < 0) {